Skip to main content
View as Markdown

User Roles (RBAC) - Content Management

User Roles (RBAC)​

Roles define what permissions a user has. Each role is a set of named permissions. Assign roles to users via user[roleIds].

KalturaUserRole Object​

FieldTypeDescription
idintegerAuto-generated role ID (read-only)
namestringRole display name
systemNamestringSystem-level name (for built-in roles)
descriptionstringRole description
statusinteger1 = ACTIVE, 2 = BLOCKED, 3 = DELETED
partnerIdinteger0 for system roles, your partner ID for custom roles
permissionNamesstringComma-separated permission names
tagsstringComma-separated tags
createdAtintegerUnix timestamp (read-only)
updatedAtintegerUnix timestamp (read-only)

Create a Role​

curl -X POST "$KALTURA_SERVICE_URL/service/userRole/action/add" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "userRole[objectType]=KalturaUserRole" \
-d "userRole[name]=Content Viewer" \
-d "userRole[description]=Read-only access to content" \
-d "userRole[permissionNames]=BASE_USER_SESSION_PERMISSION,PLAYBACK_BASE_PERMISSION"
ParameterTypeRequiredDescription
userRole[objectType]stringYesAlways KalturaUserRole
userRole[name]stringYesRole name
userRole[description]stringNoDescription
userRole[permissionNames]stringYesComma-separated permission names
userRole[tags]stringNoTags for categorization

Common permission names:

PermissionDescription
BASE_USER_SESSION_PERMISSIONRequired for basic user sessions
PLAYBACK_BASE_PERMISSIONView/play content
CONTENT_INGEST_UPLOADUpload content
CONTENT_MANAGE_BASEBasic content management
CONTENT_MANAGE_DELETEDelete content
CONTENT_MANAGE_METADATAEdit content metadata
ADMIN_BASEAdmin panel access
ANALYTICS_BASEView analytics

Response: Full KalturaUserRole object with generated id:

{
"id": 12345,
"name": "Content Viewer",
"systemName": "",
"description": "Read-only access to content",
"status": 1,
"partnerId": 976461,
"permissionNames": "BASE_USER_SESSION_PERMISSION,PLAYBACK_BASE_PERMISSION",
"tags": "",
"createdAt": 1718467200,
"updatedAt": 1718467200,
"objectType": "KalturaUserRole"
}

Get a Role​

curl -X POST "$KALTURA_SERVICE_URL/service/userRole/action/get" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "userRoleId=$USER_ROLE_ID"
ParameterTypeRequiredDescription
userRoleIdintegerYesRole ID to retrieve

Returns the full KalturaUserRole object. Returns USER_ROLE_NOT_FOUND if the role does not exist.

List Roles​

curl -X POST "$KALTURA_SERVICE_URL/service/userRole/action/list" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "filter[objectType]=KalturaUserRoleFilter" \
-d "filter[statusEqual]=1" \
-d "filter[tagsMultiLikeOr]=custom" \
-d "pager[pageSize]=50"

Filter fields (KalturaUserRoleFilter):

FieldDescription
idEqualExact role ID
idInComma-separated role IDs
statusEqual1 = ACTIVE, 2 = BLOCKED, 3 = DELETED
nameEqualExact name match
systemNameEqualExact system name match
tagsMultiLikeOrTags (OR match)
orderBy+id, -id, +createdAt, -createdAt

Update a Role​

curl -X POST "$KALTURA_SERVICE_URL/service/userRole/action/update" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "userRoleId=$USER_ROLE_ID" \
-d "userRole[objectType]=KalturaUserRole" \
-d "userRole[description]=Updated permissions" \
-d "userRole[permissionNames]=BASE_USER_SESSION_PERMISSION,PLAYBACK_BASE_PERMISSION,CONTENT_MANAGE_BASE"
ParameterTypeRequiredDescription
userRoleIdintegerYesRole ID to update
userRole[objectType]stringYesAlways KalturaUserRole
userRole[name]stringNoUpdated role name
userRole[description]stringNoUpdated description
userRole[permissionNames]stringNoUpdated comma-separated permission names (replaces all existing permissions)
userRole[tags]stringNoUpdated tags

Fields not included remain unchanged. Response: Full updated KalturaUserRole object.

Clone a Role​

curl -X POST "$KALTURA_SERVICE_URL/service/userRole/action/clone" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "userRoleId=$USER_ROLE_ID"
ParameterTypeRequiredDescription
userRoleIdintegerYesRole ID to clone

Creates a copy of an existing role. Useful for customizing built-in system roles without modifying the originals. Response: Full KalturaUserRole object for the new clone with a new id.

Delete a Role​

curl -X POST "$KALTURA_SERVICE_URL/service/userRole/action/delete" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "userRoleId=$USER_ROLE_ID"
ParameterTypeRequiredDescription
userRoleIdintegerYesRole ID to delete

Sets status=3 (DELETED). Users currently assigned this role retain it until their roleIds are updated.

Assigning Roles to Users​

Use user.update with the roleIds field to assign one or more roles:

curl -X POST "$KALTURA_SERVICE_URL/service/user/action/update" \
-d "ks=$KALTURA_KS" \
-d "format=1" \
-d "userId=jane.doe@example.com" \
-d "user[objectType]=KalturaUser" \
-d "user[roleIds]=$USER_ROLE_ID"

Use this role ID with the setrole:ROLE_ID KS privilege (see Session Guide) to create sessions that inherit the role's permissions.