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
Path Parameters
Header Parameters
Body ()
Root Schema : updateUserRoles_request
Type: object
Show Source
Example:
{
    "roles":[
        {
            "op":"add",
            "function":"approver",
            "relativeTo":{
                "id":"200002"
            }
        },
        {
            "op":"remove",
            "function":"admin",
            "relativeTo":{
                "id":"200002"
            }
        }
    ]
}
Nested Schema : roles
Type: array
List of roles to associate with the user.
Show Source
Nested Schema : items
Type: object
Show Source
  • For an organizational role, function of the role to be assigned or removed. Not allowed if type is role.
  • Operation on the role to be performed. Possible values are add and remove
  • relativeTo
    If not provided, the profile's parent organization will be used. Not allowed if type is role.
  • 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 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
Back to Top

Response

Supported Media Types

200 Response

Following model is returned when operation succeeds.
Body ()
Root Schema : updateUserRoles_response
Type: object
Show Source
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.|
Body ()
Root Schema : errorModel
Type: object
Show Source
Nested Schema : errors
Type: array
An optional list of errors if multiple errors were encountered
Show Source
Nested Schema : items
Type: object
Show Source
Back to Top