How can I test permissions on IBaselineHandle before resolving to full item?
Team,
in a code not unlike
try {
... lots of other stuff
IBaselineHandle currentBLHandle;
IBaseline currentBL = (IBaseline) teamRepository
.itemManager().fetchCompleteItem(currentBLHandle,
IItemManager.DEFAULT, null);
} catch (final PermissionDeniedException e) {
} ... and lots of other catches
how can I test the currentBLHandle for permissions before I run into the PermissionDeniedException?
gg,
Arne
in a code not unlike
try {
... lots of other stuff
IBaselineHandle currentBLHandle;
IBaseline currentBL = (IBaseline) teamRepository
.itemManager().fetchCompleteItem(currentBLHandle,
IItemManager.DEFAULT, null);
} catch (final PermissionDeniedException e) {
} ... and lots of other catches
how can I test the currentBLHandle for permissions before I run into the PermissionDeniedException?
gg,
Arne
One answer
Ah, this is how it works:
Resolve the whole list of baseline handles at once with
IFetchResult fetchResult = teamRepository.itemManager().fetchCompleteItemsPermissionAware(...)
and then test for fetchResult.hasPermissionDeniedItems() or iterate over fetchResult.getRetrievedItems()
I will comment if anything funny comes up that mandates more explicit explanations.
Resolve the whole list of baseline handles at once with
IFetchResult fetchResult = teamRepository.itemManager().fetchCompleteItemsPermissionAware(...)
and then test for fetchResult.hasPermissionDeniedItems() or iterate over fetchResult.getRetrievedItems()
I will comment if anything funny comes up that mandates more explicit explanations.