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  // id of role template
    "roleName": string  // name of role template
    "targetType": string  // type of target (like network, room or prop)
    "isBuildIn": bool  // is system build in role (cannot be overridden)
    "permissions": [ string ]  // list of role permissions
}

Response:

{
    "data": {
        "role": {
            "id": string  // id of role template
            "roleName": string  // name of role template
            "targetType": string  // type of target (like network, room or prop)
            "isBuildIn": bool  // is system build in role (cannot be overridden)
            "permissions": [ string ]  // list of role permissions
        }
    }
    "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  // id of role template
            "roleName": string  // name of role template
            "targetType": string  // type of target (like network, room or prop)
            "isBuildIn": bool  // is system build in role (cannot be overridden)
            "permissions": [ string ]  // list of role permissions
        }
    }
    "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  // id of role template
            "roleName": string  // name of role template
            "targetType": string  // type of target (like network, room or prop)
            "isBuildIn": bool  // is system build in role (cannot be overridden)
            "permissions": [ string ]  // list of role permissions
        }]
    }
    "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  // id of role template
            "roleName": string  // name of role template
            "targetType": string  // type of target (like network, room or prop)
            "isBuildIn": bool  // is system build in role (cannot be overridden)
            "permissions": [ string ]  // list of role permissions
            "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  // id of role template
            "roleName": string  // name of role template
            "targetType": string  // type of target (like network, room or prop)
            "isBuildIn": bool  // is system build in role (cannot be overridden)
            "permissions": [ string ]  // list of role permissions
            "targetId": string  // optional, id of object role is linked to
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}