/** * */ @Override public Group lookup(HttpServletRequest localRequest, GrouperSession grouperSession, String query) { Subject loggedInSubject = grouperSession.getSubject(); Group theGroup = new GroupFinder().assignPrivileges(AccessPrivilege.READ_PRIVILEGES) .assignSubject(loggedInSubject) .assignFindByUuidOrName(true).assignScope(query).findGroup(); return theGroup; }
/** * */ @Override public Stem lookup(HttpServletRequest request, GrouperSession grouperSession, String query) { Subject loggedInSubject = grouperSession.getSubject(); Stem theStem = new StemFinder().assignPrivileges(NamingPrivilege.CREATE_PRIVILEGES).assignSubject(loggedInSubject) .assignFindByUuidOrName(true).assignScope(query).findStem(); return theStem; }
public Object callback(GrouperSession grouperSession) throws GrouperSessionException { Group group = GroupFinder.findByName(grouperSession, privilegeInheritanceUpdateRequireGroup, true); if (!group.hasMember(loggedInSubject)) { return false; } return true; } })) {
public Source getSource() { try { return SubjectFinder.getSource(MemberSortWrapper.this.wrappedMember.getSubjectSourceId()); } catch (SourceUnavailableException sue) { //not sure what to do here } return null; }
/** * Returns indirect privileges for member on the group or stem * @param s * @param groupOrStem * @param member * @return Map keyed on privilege name forindirect privileges for member on the group or stem, and how derived */ public static Map getExtendedHas(GrouperSession s,GroupOrStem groupOrStem,Member member) throws SchemaException{ return getExtendedHas(s,groupOrStem,member,FieldFinder.find("members")); }
/** * Returns all privileges, direct and indirect, that member has for group or stem * @param s * @param groupOrStem * @param member * @return Map keyed on privilege names - whether direct or indirect * @throws SchemaException */ public static Map getAllHas(GrouperSession s,GroupOrStem groupOrStem,Member member) throws SchemaException{ return getAllHas(s,groupOrStem,member,FieldFinder.find("members")); }
/** * For a group id, for all its types, return fields of type LIST * @param s * @param groupId * @return List of list fields for group * @throws Exception */ public static List getListFieldsForGroup(GrouperSession s,String groupId) throws Exception{ Group g = GroupFinder.findByUuid(s,groupId); return getListFieldsForGroup(s,g); }
/** * For a group id, for all its types, return fields of type LIST which the session user can read or write * @param s * @param groupId * @return List of list fields for group * @throws Exception */ public static List getReadableListFieldsForGroup(GrouperSession s,String groupId) throws Exception{ Group g = GroupFinder.findByUuid(s,groupId); return getReadableListFieldsForGroup(s,g); }
/** * if the group has admin granted to all * @return true */ public boolean isGrantAllAdmin() { return this.group.hasAdmin(SubjectFinder.findAllSubject()); }
@Override public Object callback(GrouperSession grouperSession) throws GrouperSessionException { Group group = GroupFinder.findByUuid(grouperSession, groupId, false); if (group.hasUpdate(loggedInSubject)) { return group; } return null; } });
/** * For a group id, for all its types, return fields of type LIST which the session user can write * @param s * @param groupId * @return List of list fields for group * @throws Exception */ public static List getWritableListFieldsForGroup(GrouperSession s,String groupId) throws Exception{ Group g = GroupFinder.findByUuid(s,groupId); return getWritableListFieldsForGroup(s,g); }
/** * if the group has update granted to all * @return true */ public boolean isGrantAllUpdate() { return this.group.hasUpdate(SubjectFinder.findAllSubject()); }
/** * if the group has read granted to all * @return true */ public boolean isGrantAllRead() { return this.group.hasRead(SubjectFinder.findAllSubject()); }
/** * if the group has optout granted to all * @return true */ public boolean isGrantAllOptout() { return this.group.hasOptout(SubjectFinder.findAllSubject()); }
/** * if the group has attr update granted to all * @return true */ public boolean isGrantAllAttrUpdate() { return this.group.hasGroupAttrUpdate(SubjectFinder.findAllSubject()); }
/** * if the group has view granted to all * @return true */ public boolean isGrantAllView() { return this.group.hasView(SubjectFinder.findAllSubject()); }
/** * if the group has optin granted to all * @return true */ public boolean isGrantAllOptin() { return this.group.hasOptin(SubjectFinder.findAllSubject()); }
/** * */ @Override public Group lookup(HttpServletRequest localRequest, GrouperSession grouperSession, String query) { Subject loggedInSubject = grouperSession.getSubject(); GroupFinder groupFinder = new GroupFinder().assignPrivileges(AccessPrivilege.ATTRIBUTE_UPDATE_PRIVILEGES) .assignSubject(loggedInSubject) .assignFindByUuidOrName(true).assignScope(query).addTypeOfGroup(TypeOfGroup.role); return groupFinder.findGroup(); }
public Object callback(GrouperSession grouperSession) throws GrouperSessionException { Group group = GroupFinder.findByName(grouperSession, privilegeInheritanceReadRequireGroup, true); if (!group.hasMember(loggedInSubject)) { return false; } return true; } })) {
/** * */ @Override public Object callback(GrouperSession theGrouperSession) throws GrouperSessionException { Group requireGroup = GroupFinder.findByName(theGrouperSession, requireGroupName, true); return requireGroup.hasMember(currentUser); } });