Skip to content
On this page

Adminserver: Rbac API

EndpointMethodDescription
/jsonRpc/rbac.listPermissionsjsonRpcList permissions
/jsonRpc/rbac.createRolejsonRpcCreate role
/jsonRpc/rbac.deleteRolejsonRpcDelete role
/jsonRpc/rbac.setRolePermissionsjsonRpcSet role permissions
/jsonRpc/rbac.listRolesjsonRpcList roles
/jsonRpc/rbac.addUserRolejsonRpcAdd user role
/jsonRpc/rbac.deleteUserRolejsonRpcDelete user role
/jsonRpc/rbac.listAssignedUserRolesjsonRpcList assigned user roles
/jsonRpc/rbac.listNetworkUserRolesjsonRpcList 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 }
}