/** * {@inheritDoc} */ public Collection getEntityAuthzGroups(Reference ref, String userId) { // double check that it's mine if (!APPLICATION_ID.equals(ref.getType())) return null; Collection rv = new Vector(); try { // first, use the reference as an authzGroup (site, group, page or tool) rv.add(ref.getReference()); // do NOT use the site if the reference is a group or other part // // if this is a sub-type, add the site's reference - container is site id // if (!SITE_SUBTYPE.equals(ref.getSubType())) // { // rv.add(siteReference(ref.getContainer())); // } // add the current user's realm ref.addUserAuthzGroup(rv, userId); // site helper rv.add("!site.helper"); } catch (Exception e) { log.warn("getEntityRealms(): " + e); } return rv; }
/** * {@inheritDoc} */ public Collection getEntityAuthzGroups(Reference ref, String userId) { // double check that it's mine if (!APPLICATION_ID.equals(ref.getType())) return null; Collection rv = new Vector(); // if the reference is an AuthzGroup, and not a special one // get the list of realms for the azGroup-referenced resource if ((ref.getId() != null) && (ref.getId().length() > 0) && (!ref.getId().startsWith("!"))) { // add the current user's azGroup (for what azGroup stuff everyone can do, i.e. add) ref.addUserAuthzGroup(rv, sessionManager().getCurrentSessionUserId()); // make a new reference on the azGroup's id Reference refnew = entityManager().newReference(ref.getId()); rv.addAll(refnew.getAuthzGroups(userId)); } return rv; }