1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-09-10 17:53:36 +02:00

fix: segment project fetch when global (#5313)

Co-authored-by: Nuno Góis <github@nunogois.com>
This commit is contained in:
Jaanus Sellin 2023-11-09 15:53:18 +02:00 committed by GitHub
parent 3b23719c7f
commit fb85ae20d9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,6 @@ import {
DELETE_FEATURE,
ADMIN,
UPDATE_FEATURE,
DELETE_SEGMENT,
UPDATE_PROJECT_SEGMENT,
} from '../types/permissions';
import { IUnleashConfig } from '../types/option';
@ -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);