-
Notifications
You must be signed in to change notification settings - Fork 0
CreateRole
Luis Huertas edited this page Feb 7, 2022
·
1 revision
Creates a role
Base Url : http://your-app-base-url.com
Endpoint : /auth/role/
Method : POST
Auth required : Yes
header key | header value | description |
---|---|---|
Authorization | BEARER jwtToken | access_token generated using /token
|
Permissions required : Access string 'OAUTH2_role:create'
type: body
{
"identifier": "someRole",
"allowedObject": {
"application-part": [
{
"id": 1,
"allowed": "create"
}
]
}
}
Request Fields Description
key | value | description |
---|---|---|
identifier | someRole | The identifier of the role |
allowedObject | Object | An object where the keys are the application part identifiers and the value is an array of the option of that part that this role will have access to |
{
"code": 200001,
"message": "Role added",
"content": {
"roleId": 123
}
}
Response Fields Description
key | value | description |
---|---|---|
code | 200001 | result code |
message | Role added | result message |
content | { roleId } | created role id |
Response codes
- If response is success, http status will be 201 and code in body will be 200001
code | description |
---|---|
500000 | Not categorized error |
400000 | Invalid body |
200001 | role was created |