Merge pull request #27845 from awanlin/topic/add-missing-scaffolder-permission-to-router
Added missing scaffolder management permission
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-permission-node': patch
|
||||
---
|
||||
|
||||
The `createPermissionIntegrationRouter` function now detects and prevents the exposure of duplicate permissions.
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend': patch
|
||||
---
|
||||
|
||||
Resolved an issue where the `templateManagementPermission` was not being exposed through the `/permissions/metadata` endpoint.
|
||||
@@ -904,7 +904,7 @@ describe('createPermissionIntegrationRouter', () => {
|
||||
const response = await request(
|
||||
express().use(
|
||||
createPermissionIntegrationRouter({
|
||||
permissions: [aPermission],
|
||||
permissions: [aPermission, testPermission],
|
||||
resources: [
|
||||
{
|
||||
resourceType: 'test-resource',
|
||||
|
||||
@@ -328,11 +328,16 @@ export function createPermissionIntegrationRouter<
|
||||
>
|
||||
).rules || [],
|
||||
);
|
||||
const allPermissions = [
|
||||
...((options as { permissions: Permission[] }).permissions || []),
|
||||
...(optionsWithResources.resources?.flatMap(o => o.permissions || []) ||
|
||||
[]),
|
||||
];
|
||||
|
||||
const allPermissions = Array.from(
|
||||
new Map(
|
||||
[
|
||||
...((options as { permissions: Permission[] }).permissions || []),
|
||||
...(optionsWithResources.resources?.flatMap(o => o.permissions || []) ||
|
||||
[]),
|
||||
].map(i => [i.name, i]),
|
||||
).values(),
|
||||
);
|
||||
|
||||
const allResourceTypes = allOptions.reduce((acc, option) => {
|
||||
if (
|
||||
|
||||
@@ -41,7 +41,7 @@ import {
|
||||
RESOURCE_TYPE_SCAFFOLDER_ACTION,
|
||||
RESOURCE_TYPE_SCAFFOLDER_TEMPLATE,
|
||||
scaffolderActionPermissions,
|
||||
scaffolderTaskPermissions,
|
||||
scaffolderPermissions,
|
||||
scaffolderTemplatePermissions,
|
||||
taskCancelPermission,
|
||||
taskCreatePermission,
|
||||
@@ -445,7 +445,7 @@ export async function createRouter(
|
||||
rules: actionRules,
|
||||
},
|
||||
],
|
||||
permissions: scaffolderTaskPermissions,
|
||||
permissions: scaffolderPermissions,
|
||||
});
|
||||
|
||||
router.use(permissionIntegrationRouter);
|
||||
|
||||
Reference in New Issue
Block a user