3 [ "$include_acl" ] && return 0
6 # ACL_OVERRIDE="${ACL_OVERRIDE:-Admin:read,write}"
7 ACL_DEFAULT="${ACL_DEFAULT:-Known:read,write${BR}All:read}"
14 # Get directory part of PATH_INFO
15 local path="${path%/*}/./"
16 local pagefile head acl
18 printf '%s\n' "$ACL_OVERRIDE"
21 [ "$path" = / ] && break
24 # Do not use `mdfile` function here because of specialties
25 # in translation handler (`handlers/10_translations.sh`)
26 if [ -f "$_DATA/pages/$path/#page.md" ]; then
27 pagefile="$_DATA/pages/$path/#page.md"
28 elif [ -f "$_EXEC/pages/$path/#page.md" ]; then
29 pagefile="$_EXEC/pages/$path/#page.md"
36 /^%acl([\t ]+.*)?$/bACL;
43 /^(%[ \t]+|%acl[ \t]+|[ \t]+)[^ \t\r]+$/bACL;
44 /^(%[ \t]*|%acl[ \t]*)$/bACL;
50 printf '%s\n' "$ACL_DEFAULT"
54 local page="${1:-${PATH_INFO}}"
57 if [ "$acl_cachepath" != "$page" ]; then
59 acl_collection="$(acl_collect "$page")"
64 read|*,read,*|read,*|*,read)
65 acl="${acl%%:*}:read";;
66 *) acl="${acl%%:*}:";;
68 [ "$USER_NAME" ] && case $acl in
69 "Known:read") return 0;;
71 "+Known:read") return 0;;
72 "-Known:read") return 1;;
73 "@${USER_NAME}:read") return 0;;
74 "@${USER_NAME}:") return 1;;
75 "+@{$USER_NAME}:read") return 0;;
76 "-@{$USER_NAME}:read") return 1;;
79 "All:read") return 0;;
81 "+All:read") return 0;;
82 "-All:read") return 1;;
91 local page="${1:-${PATH_INFO}}"
94 if [ "$acl_cachepath" != "$page" ]; then
96 acl_collection="$(acl_collect "$page")"
101 write|*,write,*|write,*|*,write)
102 acl="${acl%%:*}:write";;
103 *) acl="${acl%%:*}:";;
105 [ "$USER_NAME" ] && case ${acl} in
106 "Known:write") return 0;;
108 "+Known:write") return 0;;
109 "-Known:write") return 1;;
110 "@${USER_NAME}:write") return 0;;
111 "@${USER_NAME}:") return 1;;
112 "+@{$USER_NAME}:write") return 0;;
113 "-@{$USER_NAME}:write") return 1;;
116 "All:write") return 0;;
118 "+All:write") return 0;;
119 "-All:write") return 1;;