Skip to content

Commit

Permalink
refactor: simplify permission check
Browse files Browse the repository at this point in the history
  • Loading branch information
nunogois committed Nov 8, 2023
1 parent cbf217d commit 8519bd1
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/lib/middleware/rbac-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,7 @@ const rbacMiddleware = (
// This is needed to check if the user has the right permissions on a project level
if (
!projectId &&
permissionsArray.every((permission) =>
[DELETE_SEGMENT, UPDATE_PROJECT_SEGMENT].includes(
permission,
),
)
permissionsArray.includes(UPDATE_PROJECT_SEGMENT)
) {
const { id } = params;
const segment = await segmentStore.get(id);
Expand Down

0 comments on commit 8519bd1

Please sign in to comment.