Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.JetspeedPrincipal


                String rupType = null;
                String rupName = null;
                Collection<JetspeedPrincipal> ruPrincipals = ssoManager.getPortalPrincipals(ru);
                if ((ruPrincipals != null) && !ruPrincipals.isEmpty())
                {
                    JetspeedPrincipal rup = ruPrincipals.iterator().next();
                    rupName = rup.getName();
                    if (rup.getType().getName().equals("user"))
                    {
                        rupType = "user";
                    }
                    else if (rup.getType().getName().equals("group"))
                    {
                        rupType = "group";
                    }
                }
                if ((rupName != null) && (rupType != null))
View Full Code Here


                JSSSOSiteRemoteUser rUser = ruIter.next();
                if (rUser.getPassword() != null)
                {
                    String pName = rUser.getPrincipalName();
                    String pType = rUser.getPrincipalType();
                    JetspeedPrincipal principal = null;
                    if (pType.equals("user"))
                    {
                        principal = userManager.getUser(pName);
                    }
                    else if (pType.equals("group"))
View Full Code Here

        {
            return true;
        }
        if (o instanceof JetspeedPrincipal)
        {
            JetspeedPrincipal other = (JetspeedPrincipal)o;
            return (getName().equals(other.getName()) &&
                    getType().equals(other.getType()) &&
                    (((getDomainId() != null) ? getDomainId().longValue() : 0L) == ((other.getDomainId() != null) ? other.getDomainId().longValue() : 0L)));
        }
        return false;
    }
View Full Code Here

  {
        if (username != null && username.equals(getAnonymousUser()))
        {
            throw new SecurityException(SecurityException.ANONYMOUS_USER_PROTECTED.create(username));
        }
    JetspeedPrincipal user;
   
    user = getUser(username);
    super.removePrincipal(user);
  }
View Full Code Here

               
                try
                {
                    JetspeedPrincipalType type = this.principalManagerProvider.getPrincipalType(typeName);
                    principalManager = this.principalManagerProvider.getManager(type);
                    JetspeedPrincipal principal = null;
                   
                    if (!(principalManager.principalExists(name)))
                    {
                        principal = principalManager.newPrincipal(name, jsPrincipal.isMapped());
                        JSSecurityAttributes jsSecAttrs = jsPrincipal.getSecurityAttributes();
                        if (jsSecAttrs != null)
                        {
                            for (JSNVPElement elem : jsSecAttrs.getValues())
                            {
                                principal.getSecurityAttributes().getAttribute(elem.getKey(), true).setStringValue(elem.getValue());
                            }
                        }
                        principalManager.addPrincipal(principal, null);
                    }
                   
View Full Code Here

        log.debug("recreateJetspeedPrincipalAssociations");
       
        Map<String, JetspeedPrincipalType> principalTypes = this.principalManagerProvider.getPrincipalTypeMap();
        JetspeedPrincipalManager principalManager = null;
        JetspeedPrincipalManager fromPrincipalManager = null;
        JetspeedPrincipal from = null;
        JetspeedPrincipal to = null;
       
        try
        {
            for (JSPrincipalAssociation jsAssoc : snapshot.getPrincipalAssociations())
            {
View Full Code Here

                    if ((listTemp != null) && (listTemp.size() > 0))
                    {
                        Iterator<String> _itTemp = listTemp.iterator();
                        while (_itTemp.hasNext())
                        {
                            JetspeedPrincipal p = (JetspeedPrincipal) refs.getPrincipalMap(JetspeedPrincipalType.GROUP).get(_itTemp.next());
                            if (p != null)
                                pm.grantPermission(perm, p);
                        }
                    }
                    JSUserRoles jsUserRoles = jsPermission.getRoleString();
                    if (jsUserRoles != null)
                        listTemp = getTokens(jsUserRoles.toString());
                    else
                        listTemp = null;
                    if ((listTemp != null) && (listTemp.size() > 0))
                    {
                        Iterator<String> _itTemp = listTemp.iterator();
                        while (_itTemp.hasNext())
                        {
                            JetspeedPrincipal p = (JetspeedPrincipal) refs.getPrincipalMap(JetspeedPrincipalType.ROLE).get(_itTemp.next());
                            if (p != null)
                                pm.grantPermission(perm, p);
                        }
                    }
                    JSUserUsers jsUserUsers = jsPermission.getUserString();
                    if (jsUserUsers != null)
                        listTemp = getTokens(jsUserUsers.toString());
                    else
                        listTemp = null;
                    if ((listTemp != null) && (listTemp.size() > 0))
                    {
                        Iterator<String> _itTemp = listTemp.iterator();
                        while (_itTemp.hasNext())
                        {
                            JetspeedPrincipal p = (JetspeedPrincipal) refs.getPrincipalMap(JetspeedPrincipalType.USER).get(_itTemp.next());
                            if (p != null)
                                pm.grantPermission(perm, p);
                        }
                    }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.security.JetspeedPrincipal

Copyright © 2018 www.massapicom. 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.