Custom segment user attributes.

@param userAttributes
Custom segment user attributes.
@return Returns a reference to this object so that method calls can be chained together.
427233
public SegmentDimensions withUserAttributes(java.util.Map<String, AttributeDimension> userAttributes) {
        setUserAttributes(userAttributes);
        return this;
    }
55457
public Object getAttribute(String key, Object defaultValue)
    {
        Object attributeValue = getUserAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        attributeValue = getSessionAttribute(key, null);
        if (attributeValue != null)
            return attributeValue;
        return defaultValue;
    }
909472
@Bean(name = "uPortalAccountUserSource")
    @Qualifier("uPortalInternal")
    public IPersonAttributeDao getUPortalAccountUserSource() {
        final LocalAccountPersonAttributeDao rslt = new LocalAccountPersonAttributeDao();
        rslt.setLocalAccountDao(localAccountDao);
        rslt.setUsernameAttributeProvider(getUsernameAttributeProvider());

        final Map<String, String> queryAttributeMapping = new HashMap<>();
        queryAttributeMapping.put(USERNAME_ATTRIBUTE, USERNAME_ATTRIBUTE);
        queryAttributeMapping.put(GIVEN_NAME_ATTRIBUTE, GIVEN_NAME_ATTRIBUTE);
        queryAttributeMapping.put(SIR_NAME_ATTRIBUTE, SIR_NAME_ATTRIBUTE);
        rslt.setQueryAttributeMapping(queryAttributeMapping);

        final Map<String, Set<String>> resultAttributeMapping = new HashMap<>();
        resultAttributeMapping.put(
                USERNAME_ATTRIBUTE,
                Stream.of(USERNAME_ATTRIBUTE, UID_ATTRIBUTE, USER_LOGIN_ID_ATTRIBUTE)
                        .collect(Collectors.toSet()));
        rslt.setResultAttributeMapping(resultAttributeMapping);

        return rslt;
    }
319382
@Override
	public com.liferay.commerce.product.model.CPRuleUserSegmentRel addCPRuleUserSegmentRel(
		com.liferay.commerce.product.model.CPRuleUserSegmentRel cpRuleUserSegmentRel) {
		return _cpRuleUserSegmentRelLocalService.addCPRuleUserSegmentRel(cpRuleUserSegmentRel);
	}
1329276
func (s *FindingFilter) SetUserAttributes(v []*Attribute) *FindingFilter {
	s.UserAttributes = v
	return s
}
732575
func (s *SegmentDimensions) SetUserAttributes(v map[string]*AttributeDimension) *SegmentDimensions {
	s.UserAttributes = v
	return s
}
1002546
public function setCustomUserAttributes($uid, array $attributes): UserRecord
    {
        return $this->updateUser($uid, Request\UpdateUser::new()->withCustomAttributes($attributes));
    }
898293
public static void setUser(Object user)
    {
        HttpSession session = WebContextFactory.get().getSession(true);
        session.setAttribute(USER, user);
    }
260202
public Endpoint withAttributes(java.util.Map<String, String> attributes) {
        setAttributes(attributes);
        return this;
    }
290176
@Override
    @JsonIgnore
    public Set<String> getAvailableQueryAttributes(final IPersonAttributeDaoFilter filter) {
        final IUsernameAttributeProvider usernameAttributeProvider = super.getUsernameAttributeProvider();
        return Collections.singleton(usernameAttributeProvider.getUsernameAttribute());
    }
507922
public UserAttributeType<PortletAppType<T>> getOrCreateUserAttribute()
   {
      List<Node> nodeList = childNode.get("user-attribute");
      if (nodeList != null &&  nodeList.size() > 0)
      {
         return new UserAttributeTypeImpl<PortletAppType<T>>(this, "user-attribute", childNode, nodeList.get(0));
      }
      return createUserAttribute();
   }
206358
public static List<String> getCallbackUserRoles(UserGroupCallback userGroupCallback, String userId) {
		List<String> roles = userGroupCallback != null ? userGroupCallback.getGroupsForUser(userId) : new ArrayList<>();
		if (roles == null || roles.isEmpty()) {
			roles = new ArrayList<>();
			roles.add("");
		}

		return roles;
	}
932427
def help_center_user_segment_sections(self, user_segment_id, **kwargs):
        ""
        api_path = "/api/v2/help_center/user_segments/{user_segment_id}/sections.json"
        api_path = api_path.format(user_segment_id=user_segment_id)
        return self.call(api_path, **kwargs)
191939
public static com.liferay.commerce.product.model.CPRuleUserSegmentRel updateCPRuleUserSegmentRel(
		com.liferay.commerce.product.model.CPRuleUserSegmentRel cpRuleUserSegmentRel) {
		return getService().updateCPRuleUserSegmentRel(cpRuleUserSegmentRel);
	}
501982
protected Set<String> getPermittedAttributes(final IAuthorizationPrincipal principal) {
        final Set<String> attributeNames = personAttributeDao.getPossibleUserAttributeNames();
        return getPermittedAttributes(principal, attributeNames);
    }
776799
@Override
    protected List<IPersonAttributes> getPeopleForQuery(QueryBuilder queryBuilder, String queryUserName) {

        final String currentUserName = currentUserProvider.getCurrentUserName();
        ;
        if (currentUserName == null) {
            this.logger.warn("A null name was returned by the currentUserProvider, returning null.");
            return Collections.emptyList();
        }

        if (currentUserName.equals(queryUserName)) {
            if (this.logger.isDebugEnabled()) {
                this.logger.debug("Adding attributes from the SAMLCredential for user " + currentUserName);
            }

            Authentication authentication = SecurityContextHolder.getContext().getAuthentication();
            if (authentication != null) {
                SAMLCredential credential = (SAMLCredential) authentication.getCredentials();

                if (credential != null) {

                    // Provide some optional, TRACE-level logging for what we found
                    if (logger.isTraceEnabled()) {
                        StringBuilder msg = new StringBuilder();
                        msg.append("Credential obtained!");
                        for (Attribute a : credential.getAttributes()) {
                            msg.append("\n    a.getName()=").append(a.getName())
                                    .append("\n    a.getFriendlyName()=").append(a.getFriendlyName());
                            for (XMLObject xmlo : a.getAttributeValues()) {
                                    String str = extractStringValue(xmlo);
                                    msg.append("\n        value="+str);
                            }
                        }
                        logger.trace(msg.toString());
                    }

                    // Marshall what we found into an (unmapped) IPersonAttributes object
                    final Map<String, List<Object>> attributes = new HashMap<>();
                    for (Attribute a : credential.getAttributes()) {
                        List<Object> list = new ArrayList<Object>();
                        for (XMLObject xmlo : a.getAttributeValues()) {
                            String str = extractStringValue(xmlo);
                            if (str != null) {
                                list.add(str);
                            }
                        }
                        attributes.put(a.getName(), list);
                    }
                    final IPersonAttributes personAttributes = new CaseInsensitiveNamedPersonImpl(currentUserName, attributes);
                    return Collections.singletonList(personAttributes);
                }

            }
        } else {
            // Optionally log the fact that we _didn't_ add attributes
            if (logger.isTraceEnabled()) {
                logger.trace("Skipping this DAO because "
                        + "!currentUserName.equals(queryUserName);  currentUserName="
                        + currentUserName + ", queryUserName=" + queryUserName);
            }
        }

        return Collections.emptyList();

    }
865184
public static com.liferay.commerce.product.model.CPRuleUserSegmentRel createCPRuleUserSegmentRel(
		long CPRuleUserSegmentRelId) {
		return getService().createCPRuleUserSegmentRel(CPRuleUserSegmentRelId);
	}