Adminserver: Rbac API
| Endpoint | Method | Description |
|---|---|---|
| /jsonRpc/rbac.listPermissions | jsonRpc | List permissions |
| /jsonRpc/rbac.createRole | jsonRpc | Create role |
| /jsonRpc/rbac.deleteRole | jsonRpc | Delete role |
| /jsonRpc/rbac.setRolePermissions | jsonRpc | Set role permissions |
| /jsonRpc/rbac.listRoles | jsonRpc | List roles |
| /jsonRpc/rbac.addUserRole | jsonRpc | Add user role |
| /jsonRpc/rbac.deleteUserRole | jsonRpc | Delete user role |
| /jsonRpc/rbac.listAssignedUserRoles | jsonRpc | List assigned user roles |
| /jsonRpc/rbac.listNetworkUserRoles | jsonRpc | List network user roles |
List permissions
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.listPermissions
Request:
{ empty }
Response:
{
"data": {
"permissions": [ string ]
}
"error": { "status": bool, "code": int, "message": string }
}
Create role
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.createRole
Permissions:
all
Request:
{
"id": string
"roleName": string
"targetType": string // optional, type of object role could be linked to, like network/room/prop
"isBuildIn": bool // true for system build in roles (cannot be deleted)
"permissions": [ string ]
}
Response:
{
"data": {
"role": {
"id": string
"roleName": string
"targetType": string // optional, type of object role could be linked to, like network/room/prop
"isBuildIn": bool // true for system build in roles (cannot be deleted)
"permissions": [ string ]
}
}
"error": { "status": bool, "code": int, "message": string }
}
Delete role
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.deleteRole
Permissions:
all
Request:
{
"roleId": string
}
Response:
{ empty }
Set role permissions
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.setRolePermissions
Permissions:
all
Request:
{
"roleId": string
"permissions": [ string ]
}
Response:
{
"data": {
"role": {
"id": string
"roleName": string
"targetType": string // optional, type of object role could be linked to, like network/room/prop
"isBuildIn": bool // true for system build in roles (cannot be deleted)
"permissions": [ string ]
}
}
"error": { "status": bool, "code": int, "message": string }
}
List roles
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.listRoles
Request:
{ empty }
Response:
{
"data": {
"roles": [{
"id": string
"roleName": string
"targetType": string // optional, type of object role could be linked to, like network/room/prop
"isBuildIn": bool // true for system build in roles (cannot be deleted)
"permissions": [ string ]
}]
}
"error": { "status": bool, "code": int, "message": string }
}
Add user role
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.addUserRole
Request:
{
"userId": string
"roleId": string
"targetId": string // /networkId/roomId/propId
}
Response:
{ empty }
Delete user role
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.deleteUserRole
Request:
{
"userId": string
"roleId": string
"targetId": string // /networkId/roomId/propId
}
Response:
{ empty }
List assigned user roles
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.listAssignedUserRoles
Request:
{
"userId": string
}
Response:
{
"data": {
"roles": [{
"id": string
"roleName": string
"targetType": string // optional, type of object role could be linked to, like network/room/prop
"isBuildIn": bool // true for system build in roles (cannot be deleted)
"permissions": [ string ]
"targetId": string // optional, id of object role is linked to
}]
}
"error": { "status": bool, "code": int, "message": string }
}
List network user roles
Method: jsonRpc
HTTP Method: POST
Path: /jsonRpc/rbac.listNetworkUserRoles
Description: API returns all user roles in network, including room/prop admin roles if user owns rooms/props in network.
Permissions:
all (permission not needed for listing user own roles)
Request:
{
"userId": string
}
Response:
{
"data": {
"roles": [{
"id": string
"roleName": string
"targetType": string // optional, type of object role could be linked to, like network/room/prop
"isBuildIn": bool // true for system build in roles (cannot be deleted)
"permissions": [ string ]
"targetId": string // optional, id of object role is linked to
}]
}
"error": { "status": bool, "code": int, "message": string }
}