public void addSSOUserToPrincipal(SSOUser user, JetspeedPrincipal principal) throws SecurityException { super.addAssociation(user,principal,IsRemoteIdentityForPrincipalAssociationHandler.ASSOCIATION_NAME); }
/** * @see org.apache.jetspeed.security.GroupManager#removeGroup(java.lang.String) */ public void removeGroup(String groupName) throws SecurityException { super.removePrincipal(groupName); }
/** * @see org.apache.jetspeed.security.RoleManager#updateRole(org.apache.jetspeed.security.Role) */ public void updateRole(Role role) throws SecurityException { super.updatePrincipal(role); }
public void addPrincipal(JetspeedPrincipal principal, Set<JetspeedPrincipalAssociationReference> associations) throws SecurityException validatePrincipal(principal); if (!isSynchronizing()){ Map<AssociationHandlerKey, JetspeedPrincipalAssociationType> reqAss = new HashMap<AssociationHandlerKey, JetspeedPrincipalAssociationType>(reqAssociations); if (associations != null) addAssociation(ref.ref, principal, ref.associationName); addAssociation(principal, ref.ref, ref.associationName); notifyNewPrincipal(principal);
public SSOUser addUser(String name, Long domainId, JetspeedPrincipal ownerPrincipal) throws SecurityException { SSOUser user = newUser(name, domainId); Set<JetspeedPrincipalAssociationReference> reqAssociations = new HashSet<JetspeedPrincipalAssociationReference>(); reqAssociations.add(new JetspeedPrincipalAssociationReference(JetspeedPrincipalAssociationReference.Type.TO, ownerPrincipal, IsOwnedByPrincipalAssociationHandler.ASSOCIATION_NAME)); super.addPrincipal(user, reqAssociations); // by default add a relation to the owner super.addAssociation(user, ownerPrincipal, IsRemoteIdentityForPrincipalAssociationHandler.ASSOCIATION_NAME); return user; }
public User addUser(String username, boolean mapped) throws SecurityException { User user = newUser(username, mapped); super.addPrincipal(user, null); if (log.isDebugEnabled()) log.debug("Added user: " + username); return user; }
/** * @see org.apache.jetspeed.security.RoleManager#getRolesInGroup(java.lang.String) */ @SuppressWarnings("unchecked") public List<Role> getRolesInGroup(String groupName) throws SecurityException { return (List<Role>)super.getAssociatedFrom(groupName, groupType, JetspeedPrincipalAssociationType.IS_MEMBER_OF); }
/** * @see org.apache.jetspeed.security.GroupManager#getGroupsInRole(java.lang.String) */ @SuppressWarnings("unchecked") public List<Group> getGroupsInRole(String roleName) throws SecurityException { return (List<Group>) super.getAssociatedTo(roleName, roleType, JetspeedPrincipalAssociationType.IS_MEMBER_OF); }
/** * @see org.apache.jetspeed.security.GroupManager#getGroup(java.lang.String) */ public Group getGroup(String groupName) throws SecurityException { Group group = (Group) super.getPrincipal(groupName); if (null == group) { throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.GROUP, groupName)); } return group; }
/** * @see org.apache.jetspeed.security.GroupManager#getGroups(java.lang.String) */ @SuppressWarnings("unchecked") public List<Group> getGroups(String nameFilter) throws SecurityException { return (List<Group>) super.getPrincipals(nameFilter); }
public List<User> lookupUsers(String attributeName, String attributeValue) throws SecurityException { return (List<User>) super.getPrincipalsByAttribute(attributeName, attributeValue); }
public Collection<JetspeedPrincipal> getPortalPrincipals(SSOUser remoteUser, Long portalPrincipalDomain) { Collection<JetspeedPrincipal> principalsFound = new ArrayList<JetspeedPrincipal>(); List<JetspeedPrincipalAssociationType> assTypes = super.getAssociationTypes(); for (JetspeedPrincipalAssociationType type : assTypes) { if (type.getAssociationName().equals(IsRemoteIdentityForPrincipalAssociationHandler.ASSOCIATION_NAME)){ Collection<JetspeedPrincipal> principalsForThisType = domainPrincipalAccess.getAssociatedFrom(remoteUser.getName(), getPrincipalType(), type.getToPrincipalType(), IsRemoteIdentityForPrincipalAssociationHandler.ASSOCIATION_NAME, remoteUser.getDomainId(), portalPrincipalDomain); principalsFound.addAll(principalsForThisType); } } return principalsFound; }
/** * @see org.apache.jetspeed.security.GroupManager#addGroup(java.lang.String, boolean) */ public Group addGroup(String groupName, boolean mapped) throws SecurityException { Group group = newGroup(groupName, mapped); super.addPrincipal(group, null); if (log.isDebugEnabled()) log.debug("Added group: " + groupName); return group; }
/** * @see org.apache.jetspeed.security.RoleManager#getRolesForUser(java.lang.String) */ @SuppressWarnings("unchecked") public List<Role> getRolesForUser(String username) throws SecurityException { return (List<Role>)super.getAssociatedFrom(username, userType, JetspeedPrincipalAssociationType.IS_MEMBER_OF); }
public List<User> getUsersInGroup(String groupFullPathName) throws SecurityException { return (List<User>) super.getAssociatedTo(groupFullPathName, groupType, JetspeedPrincipalAssociationType.IS_MEMBER_OF); }
/** * @see org.apache.jetspeed.security.RoleManager#getRole(java.lang.String) */ public Role getRole(String roleName) throws SecurityException { Role role = (Role) super.getPrincipal(roleName); if (null == role) { throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE, roleName)); } return role; }
/** * @see org.apache.jetspeed.security.RoleManager#getRoles(java.lang.String) */ @SuppressWarnings("unchecked") public List<Role> getRoles(String nameFilter) throws SecurityException { return (List<Role>)super.getPrincipals(nameFilter); }
/** * @see org.apache.jetspeed.security.RoleManager#removeRole(java.lang.String) */ public void removeRole(String roleName) throws SecurityException { super.removePrincipal(roleName); }
/** * @see org.apache.jetspeed.security.GroupManager#updateGroup(org.apache.jetspeed.security.Group) */ public void updateGroup(Group group) throws SecurityException { super.updatePrincipal(group); }
/** * @see org.apache.jetspeed.security.RoleManager#addRoleToGroup(java.lang.String, * java.lang.String) */ public void addRoleToGroup(String roleName, String groupName) throws SecurityException { checkInitialized(); Group group = groupManager.getGroup(groupName); if (group == null) { throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.GROUP, groupName)); } Role role = getRole(roleName); if (role == null) { throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE, roleName)); } super.addAssociation(group, role, JetspeedPrincipalAssociationType.IS_MEMBER_OF); }