for (Map.Entry<Object, Object> z : y.entrySet()) { if (z != null && z.getKey().toString().endsWith("_details_permissions")) { z.setValue(new ome.util.PermDetails((IObject) z.getValue()));
return toRType(p.getDetails().getPermissions()); } else if (o instanceof IObject) { IObject obj = (IObject) o;
public void postProcess(IObject object) { if (object.isLoaded()) { if (object instanceof PermDetails) { object = ((PermDetails) object).getInternalContext(); if (!object.isLoaded()) { return; // EARLY EXIT } } Details details = object.getDetails(); // Sets context values. this.currentUser.applyContext(details, !(object instanceof ExperimenterGroup)); final BasicEventContext c = currentUser.current(); final Permissions p = details.getPermissions(); int allow = allowUpdateOrDelete(c, object, details, // This order must match the ordered of restrictions[] // expected by p.copyRestrictions Scope.LINK, Scope.EDIT, Scope.DELETE, Scope.ANNOTATE); allow = addChgrpChownRestrictionBits(object.getClass(), details, allow); // #9635 - This is not the most efficient solution // But since it's unclear why Permission objects // are currently being shared, the safest solution // is to always produce a copy. Permissions copy = new Permissions(p); copy.copyRestrictions(allow, restrictions(object)); details.setPermissions(copy); // #9635 } }