-
Notifications
You must be signed in to change notification settings - Fork 10
REST: System and project roles management
bugzmanov edited this page Aug 2, 2012
·
17 revisions
Path: /rest/roles
Type: GET
Example:
Response:
[ "ROLE_GENESIS_ADMIN", "ROLE_GENESIS" ]
Path: /rest/roles/(roleName)
Type: GET
Example:
Response:
{
"name":"ROLE_GENESIS",
"users":[],
"groups":["asdcasdcas","qqqq","rafael","something"]
}
Path: /rest/roles/(roleName)
Type: PUT
Request body
consists form a single JSON map contains the following entries:
Entry name | Type | Mandatory | Description |
---|---|---|---|
users | List of strings | Y | List of usernames |
groups | List of string | Y | List of group names |
Example:
Request:
"users": ["ninja"],
"groups": ["some group"]
}
Response:
{
"serviceErrors":{},
"variablesErrors":{},
"compoundServiceErrors":[],
"compoundVariablesErrors":[],
"isSuccess":true,
"isNotFound":false
}
Path: /rest/projectRoles
Type: GET
Example:
Response:
[
{"name": "ROLE_GENESIS_PROJECT_ADMIN"},{ "name": "ROLE_GENESIS_PROJECT_USER"}
]
Path: /rest/projects/(projectId)/roles/(roleName)
Type: GET
Path parameters:
Parameter | Type | Description |
---|---|---|
projectId | Number | project id the env belong to |
roleName | String | One of valid project roles (returned by /rest/projectRoles) |
Response body
ExtendedRequestResult json object
Example:
Response:
{
"result":{
"users":[],
"groups":["turtles"]
},
"isSuccess":true
}
## Assign users and groups to project role
**Path:** `/rest/projects/(projectId)/roles/(roleName)`
**Type:** PUT
**Path parameters:**
<table>
<tr>
<th>
Parameter
</th>
<th>
Type
</th>
<th>
Description
</th>
</tr>
<tr>
<td>
projectId
</td>
<td>
Number
</td>
<td>
project id the env belong to
</td>
</tr>
<tr>
<td>roleName</td>
<td>String</td>
<td>One of valid project roles (returned by /rest/projectRoles)</td>
</tr>
</table>
**Request body**
consists form a single JSON map contains the following entries:
<table>
<tr>
<th>
Entry name
</th>
<th>
Type
</th>
<th>
Mandatory
</th>
<th>
Description
</th>
</tr>
<tr>
<td>
users
</td>
<td>
List of strings
</td>
<td>
Y
</td>
<td>
List of usernames
</td>
</tr>
<tr>
<td>
groups
</td>
<td>
List of string
</td>
<td>
Y
</td>
<td>
List of group names
</td>
</tr>
</table>
**Request body**
RequestResult json object
**Example:**
**Request:**
``` json
{"users":["ninja"],"groups":["some group"]}
Response:
{
"serviceErrors":{},
"variablesErrors":{},
"compoundServiceErrors":[],
"compoundVariablesErrors":[],
"isSuccess":true,
"isNotFound":false
}
Path: /rest/projects/(projectId)/permissions
Type: GET
Path parameters:
Parameter | Type | Description |
---|---|---|
projectId | Number | project id the env belong to |
Example:
Response body:
["ROLE_GENESIS_PROJECT_ADMIN", "ROLE_GENESIS_PROJECT_USER"]