Skip to content

Commit cf130ce

Browse files
committed
fix: users who can edit application can now delete the steps & pages
1 parent 794683d commit cf130ce

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/security/extendAbilityForPage.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ export async function extendAbilityForPageOnPage(
8484
// within the canDelete permissions of the application
8585
if (ability.cannot('delete', page)) {
8686
await requireApplication();
87-
if (hasApplicationPermission(user, application, 'canDelete')) {
87+
if (hasApplicationPermission(user, application, 'canUpdate')) {
8888
can('delete', 'Page', { _id: page._id });
8989
}
9090
}

src/security/extendAbilityForStep.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ export async function extendAbilityForStepOnStep(
9191
// within the canDelete permissions of the application
9292
if (ability.cannot('delete', step)) {
9393
const app = await requireApplication();
94-
if (hasApplicationPermission(user, app, 'canDelete')) {
94+
if (hasApplicationPermission(user, app, 'canUpdate')) {
9595
can('delete', 'Step', { _id: step._id });
9696
}
9797
}

0 commit comments

Comments
 (0)