public boolean isGraphCritical(Details details) { return choose().isGraphCritical(details); }
/** * Retrieves the Thumbnail object for a given Pixels ID. * * @param pixelsId Pixels ID to retrieve the Thumbnail object for. * @return returns null if the thumbnail metadata can't be found */ public Thumbnail getMetadataSimple(long pixelsId) throws ResourceError { Thumbnail thumbnail = pixelsIdMetadataMap.get(pixelsId); if (thumbnail == null && securitySystem.isGraphCritical(null)) { Pixels pixels = pixelsIdPixelsMap.get(pixelsId); long ownerId = pixels.getDetails().getOwner().getId(); throw new ResourceError(String.format( "The user id:%s may not be the owner id:%d. The owner " + "has not viewed the Pixels set id:%d and thumbnail " + "metadata is missing.", userId, ownerId, pixelsId)); } return thumbnail; }
/** * Retrieves the Thumbnail object for a given Pixels ID. * @param pixelsId Pixels ID to retrieve the Thumbnail object for. * @return See above. */ public Thumbnail getMetadata(long pixelsId) throws NoThumbnail { Thumbnail thumbnail = pixelsIdMetadataMap.get(pixelsId); if (thumbnail == null && securitySystem.isGraphCritical(null)) // maythrow { Pixels pixels = pixelsIdPixelsMap.get(pixelsId); long ownerId = pixels.getDetails().getOwner().getId(); throw new ResourceError(String.format( "The user id:%s may not be the owner id:%d. The owner " + "has not viewed the Pixels set id:%d and thumbnail " + "metadata is missing.", userId, ownerId, pixelsId)); } else if (thumbnail == null) { throw new NoThumbnail( "Fatal error retrieving thumbnail metadata for Pixels " + "set id:" + pixelsId); } return thumbnail; }
if (securitySystem.isGraphCritical(null) // May throw || currentGroupPermissions.identical(readOnly))
@Override @RolesAllowed("user") public RenderingDef retrieveRndSettings(long pixId) { Long userId = sec.getEffectiveUID(); RenderingDef rd = retrieveRndSettingsFor(pixId, userId); if (rd == null) { final EventContext ec = this.sec.getEventContext(false); final Pixels pixelsObj = this.iQuery.get(Pixels.class, pixId); final boolean isGraphCritical = this.sec.isGraphCritical(pixelsObj.getDetails()); long pixOwner = pixelsObj.getDetails().getOwner().getId(); long currentUser = ec.getCurrentUserId(); if (currentUser != pixOwner) { rd = retrieveRndSettingsFor(pixId, pixOwner); } } return rd; }