3 [ "$include_acl" ] && return 0
6 # ACL_OVERRIDE="${ACL_OVERRIDE:-Admin:read,write}"
7 ACL_DEFAULT="${ACL_DEFAULT:-Known:read,write${BR}All:read}"
13 local path="${1:-${PATH_INFO}}"
14 # Get directory part of PATH_INFO
15 local path="${path%/*}/./"
16 local pagefile head acl
18 if [ "$acl_cachepath" = "$path" ]; then
19 printf '%s\n' "$ACL_OVERRIDE" "$acl_collection" "$ACL_DEFAULT"
26 printf '%s\n' "$ACL_OVERRIDE"
29 [ "$path" = / ] && break
32 if [ -f "$_DATA/pages/$path/#page.md" ]; then
33 pagefile="$_DATA/pages/$path/#page.md"
34 elif [ -f "$_EXEC/pages/$path/#page.md" ]; then
35 pagefile="$_EXEC/pages/$path/#page.md"
42 /^%acl([\t ]+.*)?$/bACL;
49 /^(%[ \t]+|%acl[ \t]+|[ \t]+)[^ \t\r]+$/bACL;
50 /^(%[ \t]*|%acl[ \t]*)$/bACL;
54 acl_collection="${acl_collection}${acl}${BR}"
57 printf '%s\n' "$ACL_DEFAULT"
61 local page="${1:-${PATH_INFO}}"
66 read|*,read,*|read,*|*,read)
67 acl="${acl%%:*}:read";;
68 *) acl="${acl%%:*}:";;
70 [ "$USER_NAME" ] && case $acl in
71 "Known:read") return 0;;
73 "+Known:read") return 0;;
74 "-Known:read") return 1;;
75 "@${USER_NAME}:read") return 0;;
76 "@${USER_NAME}:") return 1;;
77 "+@{$USER_NAME}:read") return 0;;
78 "-@{$USER_NAME}:read") return 1;;
81 "All:read") return 0;;
83 "+All:read") return 0;;
84 "-All:read") return 1;;
87 $(acl_collect "$page")
93 local page="${1:-${PATH_INFO}}"
98 write|*,write,*|write,*|*,write)
99 acl="${acl%%:*}:write";;
100 *) acl="${acl%%:*}:";;
102 [ "$USER_NAME" ] && case ${acl} in
103 "Known:write") return 0;;
105 "+Known:write") return 0;;
106 "-Known:write") return 1;;
107 "@${USER_NAME}:write") return 0;;
108 "@${USER_NAME}:") return 1;;
109 "+@{$USER_NAME}:write") return 0;;
110 "-@{$USER_NAME}:write") return 1;;
113 "All:write") return 0;;
115 "+All:write") return 0;;
116 "-All:write") return 1;;
119 $(acl_collect "$page")