updateUserRoles
post
/ccadmin/v1/profiles/{id}/updateUserRoles
Update User Roles. This operation is used to update the roles for the profile. Optionally takes the x-ccasset-language header to get translated content in another language.
Request
Supported Media Types
- application/json
Path Parameters
Header Parameters
-
X-CCAsset-Language(optional): string
The asset language of the request
Root Schema : updateUserRoles_request
Type:
Show Source
object
-
roles:
array roles
List of roles to associate with the user.
Example:
{
"roles":[
{
"op":"add",
"function":"approver",
"relativeTo":{
"id":"200002"
}
},
{
"op":"remove",
"function":"admin",
"relativeTo":{
"id":"200002"
}
}
]
}
Nested Schema : items
Type:
Show Source
object
-
function(optional):
string
For an organizational role, function of the role to be assigned or removed. Not allowed if type is role.
-
op(optional):
string
Operation on the role to be performed. Possible values are add and remove
-
relativeTo(optional):
object relativeTo
If not provided, the profile's parent organization will be used. Not allowed if type is role.
-
repositoryId(optional):
string
Repository ID of the role to be assigned. Required for type role and for type organizationalRole if function is custom. Ignored if function is anything other than custom and type is organizationalRole
-
type(optional):
string
Type of the role which can be organizationalRole or role. If omitted, organizationalRole is assumed.
Nested Schema : relativeTo
Type:
object
If not provided, the profile's parent organization will be used. Not allowed if type is role.
Show Source
-
id(optional):
string
Organization ID of the role to be assigned or removed
Response
Supported Media Types
- application/json
200 Response
Following model is returned when operation succeeds.
Root Schema : updateUserRoles_response
Type:
Show Source
object
-
message(optional):
string
Returns Roles has been updated successfully message if action is successfull.
-
success(optional):
boolean
Returns true if the action performed successfully.
Example Response (application/json)
{
"success":true,
"links":[
{
"rel":"self",
"href":"http://localhost:9080/ccadminui/v1/profiles/bb-110000/updateUserRoles"
}
],
"message":"Roles has been updated successfully."
}
Default Response
The error response.
The following are the internal error codes thrown by this API when the request processing fails in Oracle Commerce Cloud:
|Error Code|Description|
|------------------|------------------|
|22019|If some internal error occurs while updating roles to the user.|
|22020|If roles provided is empty or null.|
|89008|If roles with op as remove from input is not available for the profile.|
|22023|If invalid op is passed in roles input.|
|89007|If other organization roles which are not associated to the profile is passed in input.|
|22002|If profile id passed is invalid.|
|89005|If user tries to remove the buyer roles.|
|22007|If roles input provided is invalid.|
|89001|If invalid organization role(s) are passed.|
Root Schema : errorModel
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
errors(optional):
array errors
An optional list of errors if multiple errors were encountered
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code
-
type(optional):
string
The URI to the HTTP state code definition
Nested Schema : errors
Type:
array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type:
Show Source
object
-
devMessage(optional):
string
An optional non-localized message containing technical information for developers
-
errorCode(optional):
string
The numerical code identifying the error
-
message(optional):
string
The localized message describing the error
-
moreInfo(optional):
string
An optional non-localized message with more information
-
o:errorPath(optional):
string
An optional machine readable description of where the error occurred
-
status(optional):
string
The HTTP status code