Skip to content

Commit

Permalink
Perms: override with userPerms only if objPerms aren't present
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacobjeevan committed Feb 17, 2025
1 parent 9d7bbb0 commit 1dbf403
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/context/PermissionContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export function PermissionProvider({
objectPermissions?: string[],
) => {
if (isSuperAdmin) return true;
return (
userPermissions.includes(permission) ||
(objectPermissions?.includes(permission) ?? false)
);
if (objectPermissions) {
return objectPermissions.includes(permission);
}
return userPermissions.includes(permission);
};

return {
Expand Down

0 comments on commit 1dbf403

Please sign in to comment.