Browse Source
Merge pull request #1207 from Budibase/bug/perms-fix
Permissions fix - fetch enriched was 403ing in public
gh-pages
Michael Drury
6 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
2 additions and
2 deletions
-
packages/server/src/utilities/security/permissions.js
|
|
|
@ -138,7 +138,7 @@ exports.doesHaveResourcePermission = ( |
|
|
|
) => { |
|
|
|
// set foundSub to not subResourceId, incase there is no subResource
|
|
|
|
let foundMain = false, |
|
|
|
foundSub = !subResourceId |
|
|
|
foundSub = false |
|
|
|
for (let [resource, level] of Object.entries(permissions)) { |
|
|
|
const levels = getAllowedLevels(level) |
|
|
|
if (resource === resourceId && levels.indexOf(permLevel) !== -1) { |
|
|
|
@ -156,7 +156,7 @@ exports.doesHaveResourcePermission = ( |
|
|
|
break |
|
|
|
} |
|
|
|
} |
|
|
|
return foundMain && foundSub |
|
|
|
return foundMain || foundSub |
|
|
|
} |
|
|
|
|
|
|
|
exports.doesHaveBasePermission = (permType, permLevel, permissionIds) => { |
|
|
|
|