92 lines
1.1 KiB
Markdown
92 lines
1.1 KiB
Markdown
## GET /api/v1/role/{id}
|
|
|
|
_Requires an authorization header_
|
|
|
|
Returns a role with id = {id}
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"communityId": "string",
|
|
"creationDate": 0
|
|
}
|
|
```
|
|
|
|
## POST /api/v1/role
|
|
|
|
_Requires an authorization header_
|
|
|
|
### Request:
|
|
|
|
```json
|
|
{
|
|
"name": "string",
|
|
"communityId": "string",
|
|
"permissions": "string[]"
|
|
}
|
|
```
|
|
|
|
Creates a new role and returns it
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"communityId": "string"
|
|
}
|
|
```
|
|
|
|
## POST /api/v1/role/{id}/assign
|
|
|
|
_Requires an authorization header_
|
|
|
|
### Request:
|
|
|
|
```json
|
|
{
|
|
"userId": "string"
|
|
}
|
|
```
|
|
|
|
Assigns a role to a user
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"communityId": "string",
|
|
"userId": "string"
|
|
}
|
|
```
|
|
|
|
## POST /api/v1/role/{id}/unassign
|
|
|
|
_Requires an authorization header_
|
|
|
|
### Request:
|
|
|
|
```json
|
|
{
|
|
"userId": "string"
|
|
}
|
|
```
|
|
|
|
Unassigns a role from a user
|
|
|
|
### Response:
|
|
|
|
```json
|
|
{
|
|
"id": "string",
|
|
"name": "string",
|
|
"communityId": "string",
|
|
"userId": "string"
|
|
}
|
|
```
|