Skip to content

Commit dfec07f

Browse files
committed
Move the public check to agentAndAppFail function
1 parent f460a8f commit dfec07f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/acl-check.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,10 +71,6 @@ function modesAllowed (kb, doc, directory, aclDoc, agent, origin, trustedOrigins
7171

7272
function agentOrGroupOK (auth, agent) {
7373
log(` Checking auth ${auth} with agent ${agent}`)
74-
if (kb.holds(auth, ACL('agentClass'), FOAF('Agent'), aclDoc)) {
75-
log(` Agent or group: Ok, its public.`)
76-
return true
77-
}
7874
if (!agent) {
7975
log(` Agent or group: Fail: not public and not logged on.`)
8076
return false
@@ -101,6 +97,10 @@ function modesAllowed (kb, doc, directory, aclDoc, agent, origin, trustedOrigins
10197
}
10298

10399
function agentAndAppFail (auth) {
100+
if (kb.holds(auth, ACL('agentClass'), FOAF('Agent'), aclDoc)) {
101+
log(` Agent or group: Ok, its public.`)
102+
return false
103+
}
104104
if (!agentOrGroupOK(auth, agent)) {
105105
log(' The agent/group/public check fails')
106106
return 'User Unauthorized'

0 commit comments

Comments
 (0)