Skip to content
On this page

Rbac API ​

EndpointMethodDescription
rbac:assignPermissionswebsocketAssign permissions
rbac:removePermissionswebsocketRemove permissions
rbac:listPermissionsForTargetwebsocketList permissions for target
rbac:createAuthClientwebsocketCreate auth client
rbac:listAuthClientswebsocketList auth clients
rbac:updateAuthClientScopewebsocketUpdate auth client scope

Assign permissions ​

Method: websocket

Endpoint: rbac:assignPermissions

Request:

{
    "data": {
        "actorType": string  // actor type to whom permissions belong to (like user or miniApp)
        "actorId": string  // actor id to whom permissions belong to (like userId or miniAppId)
        "targetType": string  // type of target (like network, room or prop)
        "targetId": string  // id of target, path of object ids (like /networkId/roomId/propId)
        "permissions": [ string ]  // list of permissions
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "error": { "status": bool, "code": int, "message": string }
}

Remove permissions ​

Method: websocket

Endpoint: rbac:removePermissions

Request:

{
    "data": {
        "actorType": string  // actor type to whom permissions belong to (like user or miniApp)
        "actorId": string  // actor id to whom permissions belong to (like userId or miniAppId)
        "targetType": string  // type of target (like network, room or prop)
        "targetId": string  // id of target, path of object ids (like /networkId/roomId/propId)
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "error": { "status": bool, "code": int, "message": string }
}

List permissions for target ​

Method: websocket

Endpoint: rbac:listPermissionsForTarget

Request:

{
    "data": {
        "targetType": string  // type of target (like network, room or prop)
        "targetId": string  // id of target, path of object ids (like /networkId/roomId/propId)
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "data": {
        "permissions": [{
            "actorType": string  // actor type to whom permissions belong to (like user or miniApp)
            "actorId": string  // actor id to whom permissions belong to (like userId or miniAppId)
            "roleId": string  // id of role template (if permissions are assigned via role)
            "roleName": string  // name of role template (if permissions are assigned via role)
            "permissions": [ string ]  // list of permissions
            "targetType": string  // type of target (like network, room or prop)
            "targetId": string  // id of target, path of object ids (like /networkId/roomId/propId)
            "networkId": string  // id of network for which permissions are valid
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

Create auth client ​

Method: websocket

Endpoint: rbac:createAuthClient

Description: Creates a new auth client. If clientId is provided it must be unique; otherwise a random one is generated. Requires superadmin (all) permission.

Request:

{
    "data": {
        "clientId": string
        "clientName": string
        "scope": [ string ]
        "redirectUris": [ string ]
        "devMode": bool
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "data": {
        "clientId": string
        "clientSecret": string
        "clientName": string
        "scope": [ string ]
        "redirectUris": [ string ]
        "authPageUrl": string
        "devMode": bool
    }
    "error": { "status": bool, "code": int, "message": string }
}

List auth clients ​

Method: websocket

Endpoint: rbac:listAuthClients

Description: Returns all registered auth clients. Client secrets are hidden. Requires superadmin (all) permission.

Request:

{ empty }

Response:

{
    "data": {
        "clients": [{
            "clientId": string
            "clientName": string
            "scope": [ string ]
            "redirectUris": [ string ]
            "authPageUrl": string
            "devMode": bool
        }]
    }
    "error": { "status": bool, "code": int, "message": string }
}

Update auth client scope ​

Method: websocket

Endpoint: rbac:updateAuthClientScope

Description: Updates the scope of an auth client. Requires superadmin (all) permission.

Request:

{
    "data": {
        "clientId": string
        "scope": [ string ]
    }
    "event": { "id": string, "date": timestamp }
}

Response:

{
    "error": { "status": bool, "code": int, "message": string }
}