Skip to content

Commit

Permalink
fix: segment project fetch when global (#5313)
Browse files Browse the repository at this point in the history
Co-authored-by: Nuno Góis <github@nunogois.com>
  • Loading branch information
sjaanus and nunogois committed Nov 9, 2023
1 parent 3b23719 commit fb85ae2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib/middleware/rbac-middleware.ts
Expand Up @@ -3,7 +3,6 @@ import {
DELETE_FEATURE,
ADMIN,
UPDATE_FEATURE,
DELETE_SEGMENT,
UPDATE_PROJECT_SEGMENT,
} from '../types/permissions';
import { IUnleashConfig } from '../types/option';
Expand Down Expand Up @@ -96,7 +95,8 @@ const rbacMiddleware = (
// This is needed to check if the user has the right permissions on a project level
if (
!projectId &&
permissionsArray.includes(UPDATE_PROJECT_SEGMENT)
permissionsArray.includes(UPDATE_PROJECT_SEGMENT) &&
params.id
) {
const { id } = params;
const { project } = await segmentStore.get(id);
Expand Down

0 comments on commit fb85ae2

Please sign in to comment.