Package org.apache.jetspeed.security

Examples of org.apache.jetspeed.security.SecurityAttributes


        if (user == null)
        {
            throw new ProfilerException("Cannot retrieve user for " + userPrincipal.getName());
        }
       
        SecurityAttributes secAttrs = user.getSecurityAttributes();
        SecurityAttribute secAtttr = secAttrs.getAttribute(PortalReservedParameters.USER_HOMEPAGE_REFRESH_FLAG);
       
        if (secAtttr != null && Boolean.parseBoolean(secAtttr.getStringValue()))
        {
            try
            {
                String templateFolder = (String) request.getAttribute(PortalReservedParameters.USER_HOMEPAGE_TEMPLATE_PATH);
               
                if (templateFolder == null)
                {
                    SecurityAttribute secAttrTemplatePath = secAttrs.getAttribute(PortalReservedParameters.USER_HOMEPAGE_TEMPLATE_PATH);
                   
                    if (secAttrTemplatePath != null)
                    {
                        templateFolder = secAttrTemplatePath.getStringValue();
                       
View Full Code Here


    }

    public Entity createEntity(JetspeedPrincipal principal)
    {
        Set<Attribute> ldapAttrValues = new HashSet<Attribute>();
        SecurityAttributes sas = principal.getSecurityAttributes();
        for (AttributeDef attrDef : searchConfiguration.getEntityAttributeDefinitionsMap().values())
        {
            if (attrDef.isMapped())
            {
                SecurityAttribute sa = sas.getAttribute(attrDef.getMappedName());
                if (sa != null)
                {
                    // currently only single-valued attributes are supported
                    AttributeImpl attr = new AttributeImpl(attrDef);
                    attr.setValue(sa.getStringValue());
View Full Code Here

                    }
                    portalUserExists = true;

                    // update portal user attributes
                    boolean portalUserAttributesUpdated = false;
                    SecurityAttributes portalUserAttributes = portalUser.getSecurityAttributes();
                    for (Map.Entry<String,String> attribute : userAttributes.entrySet())
                    {
                        String name = attribute.getKey();
                        String value = attribute.getValue();
                        SecurityAttribute userAttribute = portalUserAttributes.getAttribute(name, true);
                        if (!value.equals(userAttribute.getStringValue()))
                        {
                            userAttribute.setStringValue(value);
                            portalUserAttributesUpdated = true;
                        }
View Full Code Here

            }
           
            // assign user attributes to user
            if (userInfo != null)
            {
                SecurityAttributes userAttrs = user.getSecurityAttributes();
                Iterator info = userInfo.entrySet().iterator();
               
                while (info.hasNext())
                {          
                    Map.Entry entry = (Map.Entry) info.next();
                    userAttrs.getAttribute((String) entry.getKey(), true).setStringValue((String) entry.getValue());
                }
            }
           
            // assign profiling rules to user
            if (rules == null || rules.isEmpty())
View Full Code Here

                        }
                    }
                    JSUserAttributes attributes = jsuser.getUserInfo();
                    if (attributes != null)
                    {
                        SecurityAttributes userSecAttrs = user.getSecurityAttributes();
                       
                        for (JSNVPElement element : attributes.getValues())
                        {
                            // assume old-style user info comes from 2.1.X exports: convert
                            // user info keys into equivalent 2.2.X security attribute keys
                            String userInfoKey = element.getKey();
                            String securityAttributeKey = userInfoKey;
                            if (userInfoKey.equals(USER_INFO_SUBSITE))
                            {
                                securityAttributeKey = User.JETSPEED_USER_SUBSITE_ATTRIBUTE;
                            }
                            String securityAttributeValue = element.getValue();
                            // set security attribute
                            userSecAttrs.getAttribute(securityAttributeKey, true).setStringValue(securityAttributeValue);
                        }
                    }
                    JSNVPElements jsNVP = jsuser.getSecurityAttributes();
                    if ((jsNVP != null) && (jsNVP.getValues() != null))
                    {
                        SecurityAttributes userSecAttrs = user.getSecurityAttributes();
                       
                        for (JSNVPElement element : jsNVP.getValues())
                        {
                            userSecAttrs.getAttribute(element.getKey(), true).setStringValue(element.getValue());
                        }
                    }
                    refs.getPrincipalMap(JetspeedPrincipalType.USER).put(jsuser.getName(), user);
                    userManager.updateUser(user);
                }
View Full Code Here

TOP

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

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.