Capability voters
Many frontend features are gated through the capability system.
Backends contribute implementations of ICapabilityVoter to enable or disable actions per resource type.
This page documents the inputs seen by a voter and the capabilities currently queried by the UI.
1. How voting works
ICapabilityVoter#vote(type, identifier, capability) receives:
-
type— identifies the resource category (for exampleProjectorProjectSettings#images). -
identifier— optional resource identifier; when the capability applies to a specific instance it contains the project/library id, otherwise it isnull. -
capability— the action being tested (for examplecanCreate).
Return CapabilityResult.granted() to enable the feature, or CapabilityResult.denied("reason") to disable it.
2. Supported capabilities
2.1. Projects collection
-
type:Project -
identifier:null -
capability:-
canList— display the projects browser. -
canCreate— show the “New project” command. -
canUpload— allow ZIP uploads.
-
2.2. Individual project
-
type:Project -
identifier: project id -
capability:-
canDownload -
canRename -
canDelete -
canEdit— toggles read-only mode. -
canView
-
2.3. Libraries collection
-
type:Library -
identifier:null -
capability:canList
2.4. Individual library
-
type:Library -
identifier:{namespace}:{name}:{version} -
capability:canView
2.5. Project settings view
-
type:ProjectSettings -
identifier: project id -
capability:canView— whether the settings entry is visible.
Add your own type strings for custom tabs so voters can distinguish them.
Each tab contributed through projectSettingsTabExtensionPoint has its own type.
For example, the image settings tab uses ProjectSettings#images.
2.6. Project settings tabs
-
type:ProjectSettings#images -
identifier: project id -
capability:canView
2.7. Project General Settings
-
type:
ProjectSettings#general -
identifier: project id -
capability:canView