1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-25 00:07:47 +01:00

fix: allow permissions to be checked without project being defined (#282)

* fix: allow permissions to be checked without project being defined

* fix: change order

Co-authored-by: Ivar Conradi Østhus <ivarconr@gmail.com>
This commit is contained in:
Fredrik Strand Oseberg 2021-05-04 21:25:35 +02:00 committed by GitHub
parent e8de5bd816
commit c4f44f7558

View File

@ -21,9 +21,15 @@ const AccessProvider: FC<IAccessProvider> = ({ store, children }) => {
if (p.permission === ADMIN) {
return true;
}
if (p.permission === permission && p.project === project) {
return true;
}
if (p.permission === permission && project === undefined) {
return true;
}
return false;
});