Examples of InternalGroupPrincipal


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

                if (null != internalGroups)
                {
                    Iterator internalGroupsIter = internalGroups.iterator();
                    while (internalGroupsIter.hasNext())
                    {
                        InternalGroupPrincipal internalGroup = (InternalGroupPrincipal) internalGroupsIter.next();
                        Principal groupPrincipal = new GroupPrincipalImpl(GroupPrincipalImpl
                                .getPrincipalNameFromFullPath(internalGroup.getFullPath()));
                        if (!groupPrincipals.contains(groupPrincipal))
                        {
                            groupPrincipals.add(groupPrincipal);
                        }
                    }
View Full Code Here

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

        Preferences preferences = Preferences.userRoot().node(
                GroupPrincipalImpl.getFullPathFromPrincipalName(groupFullPathName));
        String[] fullPaths = groupHierarchyResolver.resolve(preferences);
        for (int i = 0; i < fullPaths.length; i++)
        {
            InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(fullPaths[i]);
            if (null != internalGroup)
            {
                Collection internalUsers = internalGroup.getUserPrincipals();
                if (null != internalUsers)
                {
                    Iterator internalUsersIter = internalUsers.iterator();
                    while (internalUsersIter.hasNext())
                    {
View Full Code Here

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

            isMappingOnly = true;
            internalUser = new InternalUserPrincipalImpl(UserPrincipalImpl.getFullPathFromPrincipalName(username));
        }
        Collection internalGroups = internalUser.getGroupPrincipals();
        // This should not be null. Check for null should be made by the caller.
        InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(GroupPrincipalImpl
                .getFullPathFromPrincipalName(groupFullPathName));
        // Check anyway.
        if (null == internalGroup)
        {
            throw new SecurityException(SecurityException.GROUP_DOES_NOT_EXIST.create(groupFullPathName));
View Full Code Here

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

        }
        if (null != internalUser)
        {
            Collection internalGroups = internalUser.getGroupPrincipals();
            // This should not be null. Check for null should be made by the caller.
            InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(GroupPrincipalImpl
                    .getFullPathFromPrincipalName(groupFullPathName));
            // Check anyway.
            if (null == internalGroup)
            {
                throw new SecurityException(SecurityException.GROUP_DOES_NOT_EXIST.create(groupFullPathName));
View Full Code Here

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

                */
                if ( principalFullPath.compareToIgnoreCase(fullPath) == 0)
                    return principal.getRemotePrincipals();
               
                /* Expand the Group and find a match */
              InternalGroupPrincipal  groupPrincipal = getGroupPrincipals(principalFullPath);
             
              // Found Group that matches the name
              if (groupPrincipal != null)
                {
                  Collection usersInGroup = groupPrincipal.getUserPrincipals();
                  Iterator itUsers = usersInGroup.iterator();
                    while (itUsers.hasNext())
                    {
                        InternalUserPrincipal user = (InternalUserPrincipal)itUsers.next();
                        if (user.getFullPath().compareToIgnoreCase(fullPath) == 0)
View Full Code Here

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

    {
        // Get to the backend to return the group that matches the full path
        Criteria filter = new Criteria();
        filter.addEqualTo("fullPath", principalFullPath);
        Query query = QueryFactory.newQuery(InternalGroupPrincipalImpl.class, filter);
        InternalGroupPrincipal group = (InternalGroupPrincipal) getPersistenceBrokerTemplate().getObjectByQuery(query);
        return group;      
    }
View Full Code Here

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

    public boolean equals(Object object)
    { 
        if (!(object instanceof InternalGroupPrincipal))
            return false;

        InternalGroupPrincipal r = (InternalGroupPrincipal) object;
        boolean isEqual = (r.getFullPath().equals(this.getFullPath()));
        return isEqual;
    }
View Full Code Here

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

        Preferences preferences = Preferences.userRoot().node(
                GroupPrincipalImpl.getFullPathFromPrincipalName(groupFullPathName));
        String[] fullPaths = groupHierarchyResolver.resolve(preferences);
        for (int i = 0; i < fullPaths.length; i++)
        {
            InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(fullPaths[i]);
            if (null != internalGroup)
            {
                Collection internalRoles = internalGroup.getRolePrincipals();
                if (null != internalRoles)
                {
                    Iterator internalRolesIter = internalRoles.iterator();
                    while (internalRolesIter.hasNext())
                    {
View Full Code Here

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

     * @see org.apache.jetspeed.security.spi.SecurityMappingHandler#setRolePrincipalInGroup(java.lang.String,
     *      java.lang.String)
     */
    public void setRolePrincipalInGroup(String groupFullPathName, String roleFullPathName) throws SecurityException
    {
        InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(GroupPrincipalImpl
                .getFullPathFromPrincipalName(groupFullPathName));
        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.InternalGroupPrincipal

     * @see org.apache.jetspeed.security.spi.SecurityMappingHandler#removeRolePrincipalInGroup(java.lang.String,
     *      java.lang.String)
     */
    public void removeRolePrincipalInGroup(String groupFullPathName, String roleFullPathName) throws SecurityException
    {
        InternalGroupPrincipal internalGroup = commonQueries.getInternalGroupPrincipal(GroupPrincipalImpl
                .getFullPathFromPrincipalName(groupFullPathName));
        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
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.