Package com.sap.cds.services.request
Interface ModifiableUserInfo
- All Superinterfaces:
UserInfo
Interface to modify the values of a
UserInfo
used in a RequestContext
..-
Method Summary
Modifier and TypeMethodDescriptionAdds a role to the user.addUnrestrictedAttribute
(String attribute) Deprecated.removeRole
(String role) Removes a role from the user.removeUnrestrictedAttribute
(String attribute) Deprecated.setAdditionalAttribute
(String name, Object value) Sets additional attributes.setAdditionalAttributes
(Map<String, Object> additionalAttributes) Sets the additional attributes.setAttributes
(Map<String, List<String>> attributes) Sets an attribute value of the user.setAttributeValues
(String attribute, List<String> values) Sets the value list of an attribute of the user.Sets the ID of the user.setIsAuthenticated
(boolean val) Specifies if the current user is an authenticated (i.e.setIsInternalUser
(boolean val) Specifies if the current user is an internal user.setIsSystemUser
(boolean val) Specifies if the current user is a system user.Sets the name of the user which is used for $user to uniquely identify.Sets the roles of the user.Sets the tenant of the user.setUnrestrictedAttributes
(Set<String> attributes) Deprecated.Methods inherited from interface com.sap.cds.services.request.UserInfo
as, copy, getAdditionalAttribute, getAdditionalAttributes, getAttributes, getAttributeValues, getId, getName, getRoles, getTenant, getUnrestrictedAttributes, hasRole, isAuthenticated, isInternalUser, isPrivileged, isSystemUser, isUnrestrictedAttribute
-
Method Details
-
setId
Sets the ID of the user.- Parameters:
id
- The ID to set.- Returns:
- The same
User
.
-
setName
Sets the name of the user which is used for $user to uniquely identify.- Parameters:
name
- The name to set.- Returns:
- The same
User
.
-
setTenant
Sets the tenant of the user.- Parameters:
tenant
- The tenant to set.- Returns:
- The same
User
.
-
addRole
Adds a role to the user.- Parameters:
role
- The role to add.- Returns:
- The same
User
.
-
removeRole
Removes a role from the user.- Parameters:
role
- The role to remove.- Returns:
- The same
User
.
-
setRoles
Sets the roles of the user.null
is allowed.- Parameters:
roles
- The roles to set.- Returns:
- The same
User
.
-
setAttributeValues
Sets the value list of an attribute of the user.null
is allowed.- Parameters:
attribute
- The name of the attribute.values
- The values of the attribute.- Returns:
- The same
User
.
-
setAttributes
Sets an attribute value of the user.null
is allowed.- Parameters:
attributes
- The attributes to set.- Returns:
- The same
User
.
-
setUnrestrictedAttributes
Deprecated.- Parameters:
attributes
- The name attributes to set as unrestricted.- Returns:
- The same
User
.
-
addUnrestrictedAttribute
Deprecated.Adds the attribute from the list of unrestricted attributes.- Parameters:
attribute
- The name of the attribute.- Returns:
- The same
User
.
-
removeUnrestrictedAttribute
Deprecated.Removes the attribute from the list of unrestricted attributes.- Parameters:
attribute
- The name of the attribute.- Returns:
- The same
User
.
-
setAdditionalAttributes
Sets the additional attributes.- Parameters:
additionalAttributes
- The attributes- Returns:
- The same
User
.
-
setAdditionalAttribute
Sets additional attributes.- Parameters:
name
- The name of the attributevalue
- The value of the attribute- Returns:
- The same
User
.
-
setIsAuthenticated
Specifies if the current user is an authenticated (i.e. business) user.- Parameters:
val
- The new value- Returns:
- The same
User
.
-
setIsSystemUser
Specifies if the current user is a system user.- Parameters:
val
- The new value- Returns:
- The same
User
.
-
setIsInternalUser
Specifies if the current user is an internal user.- Parameters:
val
- The new value- Returns:
- The same
User
.
-