Grant role to user on project (PUT /v3/projects/{project_id}/users/{user_id}/roles/{role_id})
Grants the specified role to the specified user on the specified project.
Granting a role to a user for a specific project allows the user to access that project.
When a user is added, a member role is granted automatically to it so it can access the default project even if a role is not granted to it later.
The granted role will become effective after the token is obtained again.
Request headers
Content-type
Indicates the format of content defined in the MIME specification.
Specify application/json. (required)
Data type | Cardinality |
---|---|
xsd:string | 1..1 |
Accept
Indicates the accept format defined in the MIME specification.
Specify application/json. (optional)
Data type | Cardinality |
---|---|
xsd:string | 1..1 |
X-Auth-Token
Valid authentication token
Data type | Cardinality |
---|---|
xsd:string | 1..1 |
Request parameters
project_id
ID of the project (required)
Data type | Cardinality | Parent element | Child element |
---|---|---|---|
xsd:string | 1..1 | None | None |
user_id
User ID (required)
Data type | Cardinality | Parent element | Child element |
---|---|---|---|
xsd:string | 1..1 | None | None |
role_id
Role ID (required)
Data type | Cardinality | Parent element | Child element |
---|---|---|---|
xsd:string | 1..1 | None | None |
Response headers
HTTP status code
Returns the HTTP status code of the request.
One of the following values will be returned.
- 204:
- Normal completion
- 400:
- Invalid access (invalid parameter, etc.)
- 401:
- Authentication error
- 403:
- Cannot access (no privileges)
- 404:
- No applicable resources
- 409:
- Data conflict occurred
- 500:
- Unexpected error
- 501:
- Has not been implemented
- 503:
- Cannot use service
Data type | Cardinality |
---|---|
int | 1..1 |
Vary
By setting or changing the following header, notification is given that expressions can be requested in a different file format.
X-Auth-Token
Data type | Cardinality |
---|---|
xsd:string | 1..1 |
Content-Length
Indicates the length of an entity in bytes.
Data type | Cardinality |
---|---|
int | 1..1 |
Date
Indicates the date when the request was created.
Data type | Cardinality |
---|---|
date | 1..1 |
Response elements
None
Example of request
PUT /v3/projects/--project-id--/users/--user-id--/roles/--role-id--
X-Auth-Token: MIIIHgYJKoZIhvcNAQcCoIIIDzCCCAsCAQExC . . .
Example of response
HTTP/1.1 204 No Content
Vary: X-Auth-Token
Content-Length: 0
Date: Thu, 04 Sep 2014 10:16:23 AM GMT