public boolean addGroup(String name, String groupType) { if (name == null || "".equals(name) || groupType == null || "".equals(groupType)) { return false; } if (isLoggedIn()) { return activeGroups.add(new SimpleGroup(name, groupType)); } else { List<String> groupTypes = null; if (preAuthenticationGroups.containsKey(name)) { groupTypes = preAuthenticationGroups.get(name); } else { groupTypes = new ArrayList<String>(); preAuthenticationGroups.put(name, groupTypes); } return groupTypes.add(groupType); } }
public boolean addRole(String roleType, String group, String groupType) { if (roleType == null || "".equals(roleType) || group == null || "".equals(group) || groupType == null || "".equals(groupType)) return false; if (isLoggedIn()) { return activeRoles.add(new SimpleRole(new SimpleRoleType(roleType), user, new SimpleGroup(group, groupType))); } else { List<String> roleTypes = null; Map<String, List<String>> groupTypes = preAuthenticationRoles.get(group); if (groupTypes != null) { roleTypes = groupTypes.get(groupType); } else { groupTypes = new HashMap<String, List<String>>(); preAuthenticationRoles.put(group, groupTypes); } if (roleTypes == null) { roleTypes = new ArrayList<String>(); groupTypes.put(groupType, roleTypes); } return roleTypes.add(roleType); } }
protected Group createGroupFromId(String id) { return new SimpleGroup(new GroupKey(id)); }
protected Group createGroupFromId(String id) { return new SimpleGroup(new GroupKey(id)); }
public GroupQueryBuilder addAssociatedGroup(String id, boolean parent) { checkNotNullArgument(id, "Group id"); Group group = new SimpleGroup(new GroupKey(id)); if (parent) { associatedParentGroups.add(group); } else { associatedChildGroups.add(group); } return this; }
public GroupQueryBuilder addAssociatedGroupsKeys(Collection<String> ids, boolean parent) { checkNotNullArgument(ids, "Groups ids"); for (String groupId : ids) { Group group = new SimpleGroup(new GroupKey(groupId)); if (parent) { associatedParentGroups.add(group); } else { associatedChildGroups.add(group); } } return this; }
public void addParent(String id) { if (GroupKey.validateKey(id)) { parents.add(new SimpleGroup(new GroupKey(id))); return; } parents.add(new SimpleUser(id)); }
public void addMember(String id) { if (GroupKey.validateKey(id)) { members.add(new SimpleGroup(new GroupKey(id))); return; } members.add(new SimpleUser(id)); }
protected IdentityType createIdentityTypeFromId(String id) { if (GroupKey.validateKey(id)) { GroupKey groupKey = new GroupKey(id); return new SimpleGroup(groupKey); } else { return new SimpleUser(id); } }
public RoleQueryBuilder setGroup(String id) { checkNotNullArgument(id, "Group id"); this.group = new SimpleGroup(new GroupKey(id)); return this; }
protected IdentityType createIdentityTypeFromId(String id) { if (GroupKey.validateKey(id)) { GroupKey groupKey = new GroupKey(id); return new SimpleGroup(groupKey); } else { return new SimpleUser(id); } }
for (String group : preAuthenticationGroups.keySet()) { for (String groupType : preAuthenticationGroups.get(group)) { activeGroups.add(new SimpleGroup(group, groupType));
protected Group createGroup(IdentityObject identityObject) { String groupType = getSessionContext().getIdentityObjectTypeMapper().getGroupType(identityObject.getIdentityType()); return new SimpleGroup(identityObject.getName(), groupType); }
Group parentGroup = new SimpleGroup(new GroupKey(parent)); Group memberGroup = new SimpleGroup(new GroupKey(member));
preCreate(new SimpleGroup(groupName, groupType)); group = new SimpleGroup(groupName, groupType); postCreate(new SimpleGroup(groupName, groupType));
Group parentGroup = new SimpleGroup(new GroupKey(parent)); User memberUser = new SimpleUser(member);
public void removeGroup(String groupId, boolean force) throws IdentityException { try { checkNotNullArgument(groupId, "Group Id"); //TODO: force preRemove(new SimpleGroup(new GroupKey(groupId))); getRepository().removeIdentityObject(getInvocationContext(), createIdentityObjectForGroupId(groupId)); if (cache != null) { cache.invalidate(cacheNS); } postRemove(new SimpleGroup(new GroupKey(groupId))); } catch (IdentityException e) { if (log.isLoggable(Level.FINER)) { log.log(Level.FINER, "Exception occurred: ", e); } throw e; } }
public void associateGroupsByKeys(String parentId, String memberId) throws IdentityException { try { checkNotNullArgument(parentId, "Parent Id"); checkNotNullArgument(memberId, "Member Id"); Group parent = new SimpleGroup(new GroupKey(parentId)); Group member = new SimpleGroup(new GroupKey(memberId)); preGroupAssociationCreate(parent, member); getRepository().createRelationship(getInvocationContext(), createIdentityObjectForGroupId(parentId), createIdentityObjectForGroupId(memberId), MEMBER, null, true); if (cache != null) { cache.invalidateAllQueries(cacheNS); cache.invalidateAllSearches(cacheNS); } postGroupAssociationCreate(parent, member); } catch (IdentityException e) { if (log.isLoggable(Level.FINER)) { log.log(Level.FINER, "Exception occurred: ", e); } throw e; } }
public void associateUserByKeys(String parentId, String memberId) throws IdentityException { try { checkNotNullArgument(parentId, "Parent group Id"); checkNotNullArgument(memberId, "Member user Id"); Group parent = new SimpleGroup(new GroupKey(parentId)); User member = new SimpleUser(memberId); preUserAssociationCreate(parent, member); getRepository().createRelationship(getInvocationContext(), createIdentityObjectForGroupId(parentId), createIdentityObjectForUserName(memberId), MEMBER, null, true); if (cache != null) { cache.invalidateAllQueries(cacheNS); cache.invalidateAllSearches(cacheNS); } postUserAssociationCreate(parent, member); } catch (IdentityException e) { if (log.isLoggable(Level.FINER)) { log.log(Level.FINER, "Exception occurred: ", e); } throw e; } }