Merge pull request #16194 from overleaf/bg-group-sso-fix-default-permission-check
fix default permission check for group sso GitOrigin-RevId: b78c3dd26d852822f06c44c2aef79daea36fc2bd
This commit is contained in:
@@ -272,8 +272,8 @@ function hasPermission(groupPolicy, capability) {
|
||||
const results = getEnforcedPolicyNames(groupPolicy).map(userPolicyName =>
|
||||
getCapabilityValueFromPolicy(userPolicyName, capability)
|
||||
)
|
||||
// if there are no results, return the default permission
|
||||
if (results.length === 0) {
|
||||
// if there are no results, or none of the policies apply, return the default permission
|
||||
if (results.length === 0 || results.every(result => result === undefined)) {
|
||||
return getDefaultPermission(capability)
|
||||
}
|
||||
// only allow the permission if all the results are true, otherwise deny it
|
||||
|
||||
Reference in New Issue
Block a user