added catalog.location.analyze and catalog.entity.validate permissions
Signed-off-by: Kashish Mittal <kmittal@redhat.com>
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
import { NotAllowedError } from '@backstage/errors';
|
||||
import { catalogEntityCreatePermission } from '@backstage/plugin-catalog-common/alpha';
|
||||
import { catalogEntityValidatePermission } from '@backstage/plugin-catalog-common/alpha';
|
||||
import { AuthorizeResult } from '@backstage/plugin-permission-common';
|
||||
import {
|
||||
CatalogProcessingOrchestrator,
|
||||
@@ -47,7 +47,7 @@ export class AuthorizedCatalogProcessingOrchestrator
|
||||
await this.permissionApi.authorize(
|
||||
[
|
||||
{
|
||||
permission: catalogEntityCreatePermission,
|
||||
permission: catalogEntityValidatePermission,
|
||||
},
|
||||
],
|
||||
{ credentials },
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { NotAllowedError } from '@backstage/errors';
|
||||
import { catalogLocationCreatePermission } from '@backstage/plugin-catalog-common/alpha';
|
||||
import { catalogLocationAnalyzePermission } from '@backstage/plugin-catalog-common/alpha';
|
||||
import { AuthorizeResult } from '@backstage/plugin-permission-common';
|
||||
import {
|
||||
BackstageCredentials,
|
||||
@@ -39,7 +39,7 @@ export class AuthorizedLocationAnalyzer implements LocationAnalyzer {
|
||||
await this.permissionApi.authorize(
|
||||
[
|
||||
{
|
||||
permission: catalogLocationCreatePermission,
|
||||
permission: catalogLocationAnalyzePermission,
|
||||
},
|
||||
],
|
||||
{ credentials: credentials },
|
||||
|
||||
@@ -20,9 +20,11 @@ export {
|
||||
catalogEntityCreatePermission,
|
||||
catalogEntityDeletePermission,
|
||||
catalogEntityRefreshPermission,
|
||||
catalogEntityValidatePermission,
|
||||
catalogLocationReadPermission,
|
||||
catalogLocationCreatePermission,
|
||||
catalogLocationDeletePermission,
|
||||
catalogLocationAnalyzePermission,
|
||||
catalogPermissions,
|
||||
} from './permissions';
|
||||
export type { CatalogEntityPermission } from './permissions';
|
||||
|
||||
@@ -91,6 +91,15 @@ export const catalogEntityRefreshPermission = createPermission({
|
||||
resourceType: RESOURCE_TYPE_CATALOG_ENTITY,
|
||||
});
|
||||
|
||||
/**
|
||||
* This permission is used to authorize validating catalog entities.
|
||||
* @alpha
|
||||
*/
|
||||
export const catalogEntityValidatePermission = createPermission({
|
||||
name: 'catalog.entity.validate',
|
||||
attributes: {},
|
||||
});
|
||||
|
||||
/**
|
||||
* This permission is used to designate actions that involve reading one or more
|
||||
* locations from the catalog.
|
||||
@@ -118,6 +127,15 @@ export const catalogLocationCreatePermission = createPermission({
|
||||
},
|
||||
});
|
||||
|
||||
/**
|
||||
* This permission is used to authorize analyzing catalog locations.
|
||||
* @alpha
|
||||
*/
|
||||
export const catalogLocationAnalyzePermission = createPermission({
|
||||
name: 'catalog.location.analyze',
|
||||
attributes: {},
|
||||
});
|
||||
|
||||
/**
|
||||
* This permission is used to designate actions that involve deleting locations
|
||||
* from the catalog.
|
||||
@@ -139,7 +157,9 @@ export const catalogPermissions = [
|
||||
catalogEntityCreatePermission,
|
||||
catalogEntityDeletePermission,
|
||||
catalogEntityRefreshPermission,
|
||||
catalogEntityValidatePermission,
|
||||
catalogLocationReadPermission,
|
||||
catalogLocationCreatePermission,
|
||||
catalogLocationDeletePermission,
|
||||
catalogLocationAnalyzePermission,
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user