Examples of SecurityAttribute


Examples of org.apache.jetspeed.security.SecurityAttribute

    public void setSecurityAttributes(Map<String, SecurityAttribute> sa)
    {
        this.attributes = new JSSecurityAttributes();
        for (Map.Entry<String, SecurityAttribute> e : sa.entrySet())
        {
            SecurityAttribute attrib = e.getValue();
            JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getStringValue());
            this.attributes.add(element);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

    public void setUserInfo(Map<String, SecurityAttribute> sa)
    {
        this.userInfo = new JSUserAttributes();
        for (Map.Entry<String, SecurityAttribute> e : sa.entrySet())
        {
            SecurityAttribute attrib = e.getValue();
            JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getStringValue());
            this.userInfo.add(element);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

    {
        Set<Attribute> ldapAttrValues = new HashSet<Attribute>();
        SecurityAttributes sas = principal.getSecurityAttributes();
        for (AttributeDef attrDef : searchConfiguration.getAttributeDefinitions())
        {
            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());
                ldapAttrValues.add(attr);
            }
        }
        return internalCreateEntity(principal.getName(), null, ldapAttrValues);
    }
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

                if (attr == null)
                {
                    if (!syncAll)
                    {
                        // if principal has attr: remove it
                        SecurityAttribute principalAttr = principalAttrs.getAttribute(attrDef.getMappedName());
                        if (principalAttr != null)
                        {
                            feedbackLogger.debug("Removing attribute {} for principal {}", principalAttr.getName(), principal.getName());
                            principalAttrs.removeAttribute(principalAttr.getName());
                            updated = true;
                        }
                    }
                }
                else if (syncAll)
                {
                    SecurityAttribute principalAttr = principalAttrs.getAttribute(attrDef.getMappedName(), true);
                    if (feedbackLogger.isDebugEnabled())
                    {
                        feedbackLogger.debug("Adding attribute {} for principal {}. Value: {}",
                                             new String[] {principalAttr.getName(), principal.getName(), attr.getValue()});
                    }
                    principalAttr.setStringValue(attr.getValue());
                    updated = true;
                }
                else
                {
                    SecurityAttribute principalAttr = principalAttrs.getAttribute(attrDef.getMappedName(), true);
                    if (!StringUtils.equals(principalAttr.getStringValue(), attr.getValue()))
                    {
                        if (feedbackLogger.isDebugEnabled())
                        {
                            feedbackLogger.debug("Attribute attribute {} for principal {}. Old value: {}, new value: {}",
                                                 new String[] {principalAttr.getName(), principal.getName(), (principalAttr.getStringValue()), attr.getValue()});
                        }
                        principalAttr.setStringValue(attr.getValue());
                        updated = true;
                    }
                }
            }
        }
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

        {
            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();
                       
                        if (templateFolder != null && "".equals(templateFolder.trim()))
                        {
                            templateFolder = null;
                        }
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

                    {
                        if (!userMgr.getAnonymousUser().equals(userPrincipal.getName())
                                && userMgr.userExists(userPrincipal.getName()))
                        {
                            User user = userMgr.getUser(userPrincipal.getName());
                            SecurityAttribute attrib = user.getSecurityAttributes().getAttribute(PortalReservedParameters.PREFERED_LOCALE_ATTRIBUTE);
                            if (attrib != null)
                            {
                                String localeString = attrib.getStringValue();
                                if (localeString != null)
                                {
                                    locale = JetspeedLocale.convertStringToLocale(localeString);
                                }
                            }
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

        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());
                    ldapAttrValues.add(attr);
                }
            }
        }
        return internalCreateEntity(principal.getName(), null, ldapAttrValues);
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

                    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;
                        }
                    }
                    if (portalUserAttributesUpdated)
                    {
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

    public void setSecurityAttributes(Map<String, SecurityAttribute> sa)
    {
        this.attributes = new JSSecurityAttributes();
        for (Map.Entry<String, SecurityAttribute> e : sa.entrySet())
        {
            SecurityAttribute attrib = e.getValue();
            JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getStringValue());
            this.attributes.add(element);
        }
    }
View Full Code Here

Examples of org.apache.jetspeed.security.SecurityAttribute

    public void setUserInfo(Map<String, SecurityAttribute> sa)
    {
        this.userInfo = new JSUserAttributes();
        for (Map.Entry<String, SecurityAttribute> e : sa.entrySet())
        {
            SecurityAttribute attrib = e.getValue();
            JSNVPElement element = new JSNVPElement(attrib.getName(), attrib.getStringValue());
            this.userInfo.add(element);
        }
    }
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.