permissions: rename permissionIntegrations to permissionsRegistry
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
+10
-10
@@ -1,15 +1,15 @@
|
||||
---
|
||||
id: permissions
|
||||
title: Permission Integrations Service
|
||||
sidebar_label: Permission Integrations
|
||||
description: Documentation for the Permission Integrations service
|
||||
title: Permissions Registry Service
|
||||
sidebar_label: Permissions Registry
|
||||
description: Documentation for the Permissions Registry service
|
||||
---
|
||||
|
||||
This service allows your plugins to register new permissions, rules, and resource types and integrate with [the permissions framework](../../permissions/overview.md).
|
||||
|
||||
## Using the service
|
||||
|
||||
For a deep dive into how to use the `permissionIntegrations` service, see the [permission guide for plugin authors](../../permissions/plugin-authors/01-setup.md).
|
||||
For a deep dive into how to use the `permissionsRegistry` service, see the [permission guide for plugin authors](../../permissions/plugin-authors/01-setup.md).
|
||||
|
||||
If all you want to do is add new custom permission rules to an existing plugin, you can instead refer to the [custom permission rules guide](../../permissions/custom-rules.md).
|
||||
|
||||
@@ -38,7 +38,7 @@ export async function createRouter() {
|
||||
}
|
||||
```
|
||||
|
||||
Next, add a dependency on the `PermissionIntegrationsService` to your plugin,
|
||||
Next, add a dependency on the `PermissionsRegistryService` to your plugin,
|
||||
and pass it the same options:
|
||||
|
||||
```ts
|
||||
@@ -49,16 +49,16 @@ export const examplePlugin = createBackendPlugin({
|
||||
deps: {
|
||||
logger: coreServices.logger,
|
||||
/* highlight-add-next-line */
|
||||
permissionIntegrations: coreServices.permissionIntegrations,
|
||||
permissionsRegistry: coreServices.permissionsRegistry,
|
||||
},
|
||||
/* highlight-remove-next-line */
|
||||
async init({ logger }) {
|
||||
/* highlight-add-next-line */
|
||||
async init({ logger, permissionIntegrations }) {
|
||||
async init({ logger, permissionsRegistry }) {
|
||||
logger.log('This is a silly example plugin with no functionality');
|
||||
|
||||
/* highlight-add-start */
|
||||
permissionIntegrations.addResourceType({
|
||||
permissionsRegistry.addResourceType({
|
||||
resourceType: RESOURCE_TYPE_MY_RESOURCE,
|
||||
permissions: [myResourcePermissions],
|
||||
rules: [myResourceRule],
|
||||
@@ -72,9 +72,9 @@ export const examplePlugin = createBackendPlugin({
|
||||
|
||||
If you only passed the `permissions` option to
|
||||
`createPermissionIntegrationRouter`, you will want to use
|
||||
`permissionIntegrations.addPermissions` instead.
|
||||
`permissionsRegistry.addPermissions` instead.
|
||||
|
||||
If you passed multiple resources types to `createPermissionIntegrationRouter`
|
||||
via the `resources` option, you will want to call
|
||||
`permissionIntegrations.addResourceType` multiple times for each of those
|
||||
`permissionsRegistry.addResourceType` multiple times for each of those
|
||||
resource types.
|
||||
Reference in New Issue
Block a user