Examples of InternalRolePrincipal


Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

    public InternalRolePrincipal getInternalRolePrincipal(String roleFullPathName)
    {
        Criteria filter = new Criteria();
        filter.addEqualTo("fullPath", roleFullPathName);
        Query query = QueryFactory.newQuery(InternalRolePrincipalImpl.class, filter);
        InternalRolePrincipal internalRole = (InternalRolePrincipal) getPersistenceBrokerTemplate().getObjectByQuery(query);
        return internalRole;
    }
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

            if (null != internalRoles)
            {
                Iterator internalRolesIter = internalRoles.iterator();
                while (internalRolesIter.hasNext())
                {
                    InternalRolePrincipal internalRole = (InternalRolePrincipal) internalRolesIter.next();
                    Preferences preferences = Preferences.userRoot().node(internalRole.getFullPath());
                    String[] fullPaths = roleHierarchyResolver.resolve(preferences);
                    for (int i = 0; i < fullPaths.length; i++)
                    {
                        Principal rolePrincipal = new RolePrincipalImpl(RolePrincipalImpl
                                .getPrincipalNameFromFullPath(fullPaths[i]));
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

            isMappingOnly = true;
            internalUser = new InternalUserPrincipalImpl(UserPrincipalImpl.getFullPathFromPrincipalName(username));
        }
        Collection internalRoles = internalUser.getRolePrincipals();
        // This should not be null. Check for null should be made by the caller.
        InternalRolePrincipal internalRole = commonQueries.getInternalRolePrincipal(RolePrincipalImpl
                .getFullPathFromPrincipalName(roleFullPathName));
        // Check anyway.
        if (null == internalRole)
        {
            throw new SecurityException(SecurityException.ROLE_DOES_NOT_EXIST.create(roleFullPathName));
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

        }
        if (null != internalUser)
        {
            Collection internalRoles = internalUser.getRolePrincipals();
            // This should not be null. Check for null should be made by the caller.
            InternalRolePrincipal internalRole = commonQueries.getInternalRolePrincipal(RolePrincipalImpl
                    .getFullPathFromPrincipalName(roleFullPathName));
            // Check anyway.
            if (null == internalRole)
            {
                throw new SecurityException(SecurityException.ROLE_DOES_NOT_EXIST.create(roleFullPathName));
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

                if (null != internalRoles)
                {
                    Iterator internalRolesIter = internalRoles.iterator();
                    while (internalRolesIter.hasNext())
                    {
                        InternalRolePrincipal internalRole = (InternalRolePrincipal) internalRolesIter.next();
                        Principal rolePrincipal = new RolePrincipalImpl(UserPrincipalImpl
                                .getPrincipalNameFromFullPath(internalRole.getFullPath()));
                        if (!rolePrincipals.contains(rolePrincipal))
                        {
                            rolePrincipals.add(rolePrincipal);
                        }
                    }
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

        if (null == internalGroup)
        {
            throw new SecurityException(SecurityException.GROUP_DOES_NOT_EXIST.create(groupFullPathName));
        }
        Collection internalRoles = internalGroup.getRolePrincipals();
        InternalRolePrincipal internalRole = commonQueries.getInternalRolePrincipal(RolePrincipalImpl
                .getFullPathFromPrincipalName(roleFullPathName));
        internalRoles.add(internalRole);
        internalGroup.setRolePrincipals(internalRoles);
        commonQueries.setInternalGroupPrincipal(internalGroup, false);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

        if (null == internalGroup)
        {
            throw new SecurityException(SecurityException.GROUP_DOES_NOT_EXIST.create(internalGroup));
        }
        Collection internalRoles = internalGroup.getRolePrincipals();
        InternalRolePrincipal internalRole = commonQueries.getInternalRolePrincipal(RolePrincipalImpl
                .getFullPathFromPrincipalName(roleFullPathName));
        internalRoles.remove(internalRole);
        internalGroup.setRolePrincipals(internalRoles);
        commonQueries.setInternalGroupPrincipal(internalGroup, false);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

        Preferences preferences = Preferences.userRoot().node(
                RolePrincipalImpl.getFullPathFromPrincipalName(roleFullPathName));
        String[] fullPaths = roleHierarchyResolver.resolve(preferences);
        for (int i = 0; i < fullPaths.length; i++)
        {
            InternalRolePrincipal internalRole = commonQueries.getInternalRolePrincipal(fullPaths[i]);
            if (null != internalRole)
            {
                Collection internalGroups = internalRole.getGroupPrincipals();
                if (null != internalGroups)
                {
                    Iterator internalGroupsIter = internalGroups.iterator();
                    while (internalGroupsIter.hasNext())
                    {
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

        Preferences preferences = Preferences.userRoot().node(
                RolePrincipalImpl.getFullPathFromPrincipalName(roleFullPathName));
        String[] fullPaths = roleHierarchyResolver.resolve(preferences);
        for (int i = 0; i < fullPaths.length; i++)
        {
            InternalRolePrincipal internalRole = commonQueries.getInternalRolePrincipal(fullPaths[i]);
            if (null != internalRole)
            {
                Collection internalUsers = internalRole.getUserPrincipals();
                if (null != internalUsers)
                {
                    Iterator internalUsersIter = internalUsers.iterator();
                    while (internalUsersIter.hasNext())
                    {
View Full Code Here

Examples of org.apache.jetspeed.security.om.InternalRolePrincipal

     * @see org.apache.jetspeed.security.spi.RoleSecurityHandler#getRolePrincipal(java.lang.String)
     */
    public RolePrincipal getRolePrincipal(String roleFullPathName)
    {
        RolePrincipal rolePrincipal = null;
        InternalRolePrincipal internalRole = commonQueries
                .getInternalRolePrincipal(RolePrincipalImpl
                        .getFullPathFromPrincipalName(roleFullPathName));
        if (null != internalRole)
        {
            rolePrincipal = new RolePrincipalImpl(RolePrincipalImpl
                    .getPrincipalNameFromFullPath(internalRole.getFullPath()));
        }
        return rolePrincipal;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.