public void addSSOUserToPrincipal(SSOUser user, JetspeedPrincipal principal) throws SecurityException { super.addAssociation(user,principal,IsRemoteIdentityForPrincipalAssociationHandler.ASSOCIATION_NAME); }
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; }
/** * @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); }
/** * @see org.apache.jetspeed.security.RoleManager#addRoleToUser(java.lang.String, * java.lang.String) */ public void addRoleToUser(String username, String roleName) throws SecurityException { checkInitialized(); User user = userManager.getUser(username); if (user == null) { throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.USER, username)); } Role role = getRole(roleName); if (role == null) { throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.ROLE, roleName)); } super.addAssociation(user, role, JetspeedPrincipalAssociationType.IS_MEMBER_OF); }
/** * @see org.apache.jetspeed.security.GroupManager#addUserToGroup(java.lang.String, * java.lang.String) */ public void addUserToGroup(String username, String groupName) throws SecurityException { checkInitialized(); User user = userManager.getUser(username); if (user == null) { throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.USER, username)); } Group group = getGroup(groupName); if (group == null) { throw new SecurityException(SecurityException.PRINCIPAL_DOES_NOT_EXIST.createScoped(JetspeedPrincipalType.GROUP, groupName)); } super.addAssociation(user, group, JetspeedPrincipalAssociationType.IS_MEMBER_OF); }
addAssociation(ref.ref, principal, ref.associationName); addAssociation(principal, ref.ref, ref.associationName);