mirror of
https://github.com/MrUnknownDE/panel.git
synced 2026-04-17 13:53:45 +02:00
Fix array fill logicl; allow matching on any permissions
This commit is contained in:
@@ -6,9 +6,7 @@ export const usePermissions = (action: string | string[]): boolean[] => {
|
||||
|
||||
return useDeepMemo(() => {
|
||||
if (userPermissions[0] === '*') {
|
||||
return ([] as boolean[]).fill(
|
||||
true, 0, Array.isArray(action) ? action.length : 1,
|
||||
);
|
||||
return Array(Array.isArray(action) ? action.length : 1).fill(true);
|
||||
}
|
||||
|
||||
return (Array.isArray(action) ? action : [ action ])
|
||||
|
||||
Reference in New Issue
Block a user