Skip to content

Commit

Permalink
only use the site rule if there is no group rule
Browse files Browse the repository at this point in the history
this way, if there is a specific access restriction on the item then it will override the site protection
  • Loading branch information
jdub233 committed Oct 3, 2023
1 parent dc97d2c commit 2db6d15
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/authorizeRequest/authorizeRequest.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,8 @@ async function authorizeRequest(userRequest, siteRule) {
let isRootSite = indexOfRestricted ? indexOfRestricted < 5 : false;

// If there is a whole-site protection rule, the group name will be the value of the rule.
if (siteRule) {
// Unless there is also a groupName from the file path, then groupName takes precedence.
if (siteRule && !groupName) {
groupName = Object.values(siteRule)[0];
// If there's nothing after the domain, then this is a root site.
isRootSite = Object.keys(siteRule)[0] === domain;
Expand Down

0 comments on commit 2db6d15

Please sign in to comment.