for (String groupName : groupNames) { if (groupName != null) { Group group = groupService.findByName(context, groupName); if (group != null) { groups.add(group);
@Override public List<Group> getSpecialGroups(Context context, HttpServletRequest request) { // Prevents anonymous users from being added to this group, and the second check // ensures they are LDAP users try { if (!context.getCurrentUser().getNetid().equals("")) { String groupName = ConfigurationManager.getProperty("authentication-ldap", "login.specialgroup"); if ((groupName != null) && (!groupName.trim().equals(""))) { Group ldapGroup = groupService.findByName(context, groupName); if (ldapGroup == null) { // Oops - the group isn't there. log.warn(LogManager.getHeader(context, "ldap_specialgroup", "Group defined in login.specialgroup does not exist")); return Collections.EMPTY_LIST; } else { return Arrays.asList(ldapGroup); } } } } catch (Exception npe) { // The user is not an LDAP user, so we don't need to worry about them } return Collections.EMPTY_LIST; }
myGroup = groupService.findByName(c, groupName); } catch (SQLException sqle) { System.out.println("SQL Exception finding group name: "
Group group = groupService.findByName(context, groupName); if (group != null) { Group group = groupService.findByName(context, groupName); if (group != null) {
StringBuilder resourceQuery = new StringBuilder(); Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS); String anonGroupId = ""; if (anonymousGroup != null) {
Group ldapGroup = groupService.findByName(context, dspaceGroupName); if (ldapGroup != null) { groupService.addMember(context, ldapGroup, context.getCurrentUser());
Group group = groupService.findByName(c, contact); if (group != null) { epList.addAll(groupService.allMembers(c, group));
if ((groupName != null) && (!groupName.trim().equals(""))) { Group specialGroup = EPersonServiceFactory.getInstance().getGroupService() .findByName(context, groupName); if (specialGroup == null) {
for (SimpleGrantedAuthority grantedAuthority : specialGroups) { context.setSpecialGroup(EPersonServiceFactory.getInstance().getGroupService() .findByName(context, grantedAuthority.getAuthority()) .getID());
@Override public void initDefaultGroupNames(Context context) throws SQLException, AuthorizeException { GroupService groupService = EPersonServiceFactory.getInstance().getGroupService(); // Check for Anonymous group. If not found, create it Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS); if (anonymousGroup == null) { anonymousGroup = groupService.create(context); anonymousGroup.setName(Group.ANONYMOUS); anonymousGroup.setPermanent(true); groupService.update(context, anonymousGroup); } // Check for Administrator group. If not found, create it Group adminGroup = groupService.findByName(context, Group.ADMIN); if (adminGroup == null) { adminGroup = groupService.create(context); adminGroup.setName(Group.ADMIN); adminGroup.setPermanent(true); groupService.update(context, adminGroup); } }
public static Group getRoleGroup(Context context, Collection collection, Role role) throws SQLException { if (role.getScope() == Role.Scope.REPOSITORY) { return groupService.findByName(context, role.getName()); } else if (role.getScope() == Role.Scope.COLLECTION) { CollectionRole collectionRole = collectionRoleService.find(context, collection, role.getId()); if (collectionRole == null) { return null; } return collectionRole.getGroup(); } else if (role.getScope() == Role.Scope.ITEM) { } return null; }
Group group = groupService.findByName(context, ce.permissionsGroupName);
groupService.findByName(context, Group.ANONYMOUS), null, embargoDate, Constants.READ, reason, dso); if (rp != null) {
Group anonymous = groupService.findByName(context, Group.ANONYMOUS); authorizeService.addPolicy(context, b, Constants.READ, anonymous); } else {
/** * add an anonymous group permission policy to the collection for this * action */ private static void addAnonymousPolicy(Context c, DSpaceObject t, int myaction) throws SQLException, AuthorizeException { // group 0 is the anonymous group! Group anonymousGroup = EPersonServiceFactory.getInstance().getGroupService().findByName(c, Group.ANONYMOUS); // now create the default policies for submitted items ResourcePolicyService resourcePolicyService = AuthorizeServiceFactory.getInstance().getResourcePolicyService(); ResourcePolicy myPolicy = resourcePolicyService.create(c); myPolicy.setdSpaceObject(t); myPolicy.setAction(myaction); myPolicy.setGroup(anonymousGroup); resourcePolicyService.update(c, myPolicy); } }
Group admins = groupService.findByName(context, Group.ADMIN);
Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS);
EPersonServiceFactory.getInstance() .getGroupService() .findByName(context, Group.ANONYMOUS), null, embargoDate, Constants.READ, reason, dso); if (rp != null) {
public RoleMembers getMembers(Context context, XmlWorkflowItem wfi) throws SQLException { if (scope == Scope.REPOSITORY) { Group group = groupService.findByName(context, name); if (group == null) { return new RoleMembers();
Group anonymousGroup = groupService.findByName(context, Group.ANONYMOUS);