Skip to content

Commit

Permalink
fix(RBAC): Refine type definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
bastilian committed Jul 28, 2022
1 parent c11c809 commit 98e4894
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions packages/components/src/RBACProvider/RBACProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import {
initialPermissions,
} from '@redhat-cloud-services/frontend-components-utilities/RBAC';

const hasAccessWithUserPermissions = (userPermissions: Access[]) => {
return (requiredPermissions: any, checkAll = true) => {
const hasAccessWithUserPermissions = (userPermissions: (Access | string)[]) => {
return (requiredPermissions: string[], checkAll = true): boolean => {
return checkAll ? hasAllPermissions(userPermissions, requiredPermissions) : doesHavePermissions(userPermissions, requiredPermissions);
};
};
Expand Down
2 changes: 1 addition & 1 deletion packages/utils/src/RBAC/RBAC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const initialPermissions = {
isLoading: true,
isOrgAdmin: false,
permissions: [],
hasAccess: (_?: any) => {
hasAccess: (_?: (Access | string)[]) => {
return;
},
};
Expand Down

0 comments on commit 98e4894

Please sign in to comment.