protected void overrides() { override("merge", new MergeEventListener(cd, th)); override("save", new SaveEventListener(cd, th)); override(new String[] { "replicate", "update" }, getDisablingProxy()); }
/** * Replaces all the simple-valued fields in the {@link BasicEventContext}. * This method */ void checkAndInitialize(EventContext ec, LocalAdmin admin, ShareStore store) { current().checkAndInitialize(ec, admin, store); }
public Details newTransientDetails(IObject object) throws ApiUsageException, SecurityViolation { checkReady("transientDetails"); return interceptor.newTransientDetails(object); }
/** * Checks if the current {@link Thread} has non-null {@link Experimenter}, * {@link Event}, and {@link ExperimenterGroup}, required for proper * functioning of the security system. */ public boolean isReady() { BasicEventContext c = current(); if (c.getEvent() != null && c.getGroup() != null && c.getOwner() != null) { return true; } return false; }
public boolean allowAnnotate(IObject iObject, Details trustedDetails) { BasicEventContext c = currentUser.current(); return 1 == allowUpdateOrDelete(c, iObject, trustedDetails, Scope.ANNOTATE); }
public Details checkManagedDetails(IObject object, Details trustedDetails) throws ApiUsageException, SecurityViolation { checkReady("managedDetails"); return interceptor.checkManagedDetails(object, trustedDetails); }
/** * Checks the "groupPermissions" map in {@link BasicEventContext} which has * been filled up by calls to {@link BasicEventContext#setPermissionsForGroup(Long, Permissions)} * during {@link BasicACLVoter#allowLoad(org.hibernate.Session, Class, Details, long)}. * @param session the Hibernate session */ public void loadPermissions(org.hibernate.Session session) { current().loadPermissions(session); }
public void clearDisabled() { current().setDisabledSubsystems(null); }
void setup(Ice.Current current) { if (current != null) { cd.setContext(current.ctx); } }
/** * @see <a href="https://trac.openmicroscopy.org/ome/ticket/2219">ticket:2219</a> */ public void resetReadFilter(org.hibernate.Session s) { // ticket:2397 and ticket:2219 // Necessary to update the current filter in order to // have the new shareId be updated BasicSecuritySystem bss = (BasicSecuritySystem) sec; bss.loadEventContext(true); bss.updateReadFilter(s); }
public boolean removeDisabled(String id) { Set<String> s = current().getDisabledSubsystems(); if (s != null && id != null) { return s.remove(id); } return false; }
/** * @return if the current user is the system's <q>guest</q> user */ public boolean isCurrentUserGuest() { return current().getCurrentUserId() == roles.getGuestId(); }
public boolean allowCreation(IObject iObject) { if (tokenHolder.hasPrivilegedToken(iObject)) { return true; } return false; }
@Override protected boolean disabled(MethodInvocation mi) { return cd.isDisabled(k);// getType(mi)); } });
/** calls override for each key */ protected void override(String[] keys, Object object) { for (String key : keys) { override(key, object); } }
/** * @return the current event context */ public EventContext getCurrentEventContext() { return current(); }
/** * @see TokenHolder#copyToken(IObject, IObject) */ public void copyToken(IObject source, IObject copy) { tokenHolder.copyToken(source, copy); }
public boolean allowDelete(IObject iObject, Details trustedDetails) { BasicEventContext c = currentUser.current(); return 1 == allowUpdateOrDelete(c, iObject, trustedDetails, Scope.DELETE); }