permissions: add support for adding permission rules separately from resource type

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2025-01-08 09:51:03 +01:00
parent a19cb2b8a5
commit 45e0c1d645
6 changed files with 60 additions and 20 deletions
@@ -77,6 +77,21 @@ export interface PermissionIntegrationsService {
*/
addPermissions(permissions: Permission[]): void;
/**
* Adds a set of permission rules to the permission system for a resource type
* that is owned by this plugin.
*
* @remarks
*
* Rules should be created using corresponding `create*PermissionRule`
* functions exported by plugins, who in turn are created with
* `makeCreatePermissionRule`.
*
* Rules can be added either directly by the plugin itself or through a plugin
* module.
*/
addPermissionRules(rules: PermissionRule<any, any, string>[]): void;
/**
* Add a new resource type that is owned by this plugin to the permission
* system.