public boolean hasRole(String roleType, String group, String groupType) { if (!securityEnabled) return true; if (systemOp != null && Boolean.TRUE.equals(systemOp.get())) return true; tryLogin(); for (Role role : activeRoles) { if (role.getRoleType().getName().equals(roleType) && role.getGroup().getName().equals(group) && role.getGroup().getGroupType().equals(groupType)) { return true; } } return false; }
/** * Removes a role from the authenticated user * * @param role The name of the role to remove */ public void removeRole(String roleType, String group, String groupType) { for (Role role : activeRoles) { if (role.getRoleType().getName().equals(roleType) && role.getGroup().getName().equals(group) && role.getGroup().getGroupType().equals(groupType)) { activeRoles.remove(role); return; } } }
protected IdentityObjectRelationship createIdentityObjectRelationship(Role role) { return new SimpleIdentityObjectRelationship( createIdentityObject(role.getGroup()), createIdentityObject(role.getUser()), role.getRoleType().getName(), ROLE ); }
Group exoGroup = convertGroup(role.getGroup()); if (mmm.isCreateMembership(role.getRoleType().getName(), exoGroup.getId())) { exoGroups.add(exoGroup);
Group exoGroup = convertGroup(role.getGroup()); if (mmm.isCreateMembership(role.getRoleType().getName(), exoGroup.getId())) { exoGroups.add(exoGroup);
Group g = ((GroupDAOImpl) orgService.getGroupHandler()).convertGroup(role.getGroup()); m.setGroupId(g.getId()); m.setUserName(role.getUser().getId());
public void removeRole(Role role) throws IdentityException { checkNotNullArgument(role, "Role"); preRemove(role); getRepository().removeRelationship(getInvocationContext(), createIdentityObject(role.getGroup()), createIdentityObject(role.getUser()), ROLE, role.getRoleType().getName()); if (cache != null) { cache.invalidateAllQueries(cacheNS); cache.invalidateAllSearches(cacheNS); cache.removeRole(cacheNS, role); } postRemove(role); }
.convertGroup(role.getGroup());
Group g = ((GroupDAOImpl) orgService.getGroupHandler()).convertGroup(role.getGroup()); if (isCreateMembership(role.getRoleType().getName(), g.getId())) { MembershipImpl m = new MembershipImpl();