summaryrefslogtreecommitdiffstats
path: root/app/acf-util/roles-html.lsp
diff options
context:
space:
mode:
authorTed Trask <ttrask01@yahoo.com>2009-12-21 16:46:20 +0000
committerTed Trask <ttrask01@yahoo.com>2009-12-21 16:46:20 +0000
commit4ebeb9d3bc2f123f93338bcc8b15ef1723d4eb35 (patch)
treec6eeb6038a2dfb3b6dbbae2dbd96852e9653755c /app/acf-util/roles-html.lsp
parentb5b8c138deb5d4b4216c9186e3d528792edc70b2 (diff)
downloadacf-core-4ebeb9d3bc2f123f93338bcc8b15ef1723d4eb35.tar.bz2
acf-core-4ebeb9d3bc2f123f93338bcc8b15ef1723d4eb35.tar.xz
Modified permissions from controller:action to prefix/controller/action.
Had to move welcome to the acf-util prefix. Changed format of roles files: old ACF format will still work, but authenticator format won't.
Diffstat (limited to 'app/acf-util/roles-html.lsp')
-rw-r--r--app/acf-util/roles-html.lsp57
1 files changed, 29 insertions, 28 deletions
diff --git a/app/acf-util/roles-html.lsp b/app/acf-util/roles-html.lsp
index 090421f..32000af 100644
--- a/app/acf-util/roles-html.lsp
+++ b/app/acf-util/roles-html.lsp
@@ -1,9 +1,5 @@
<% local view= ... %>
-<% --[[
- io.write(html.cfe_unpack(view))
---]] %>
-<% ---[[ %>
<% if view.value.userid then %>
<H1>Roles/Permission list for <%= html.html_escape(view.value.userid.value) %>:</H1>
<% elseif view.value.role then %>
@@ -20,9 +16,7 @@
end %>
</DL>
<% end %>
-<% --]] %>
-<% ---[[ %>
<% if view.value.permissions then %>
<% if view.value.userid then %>
<H2><%= html.html_escape(view.value.userid.value) %>'s full permissions are</H2>
@@ -30,29 +24,36 @@
<H2><%= html.html_escape(view.value.role.value) %>'s full permissions are</H2>
<% end %>
<DL>
- <% local controllers = {}
- -- It's nice to have it in alphabetical order
- for cont in pairs(view.value.permissions.value) do
- controllers[#controllers + 1] = cont
- end
- table.sort(controllers)
- io.write("<TABLE>")
- io.write("<TR><TD CLASS='header'>Controller</TD><TD CLASS='header'>Action(s)</TD>")
- for x,cont in ipairs(controllers) do
- print("<TR><TD STYLE='font-weight:bold;'>",html.html_escape(cont),"</TD><TD>")
- -- Again, alphabetical order
- local actions = {}
- for act in pairs(view.value.permissions.value[cont]) do
- actions[#actions + 1] = act
+ <TABLE>
+ <TR><TD CLASS='header'>Controller</TD><TD CLASS='header'>Action(s)</TD></TR>
+ <% local prefixes = {}
+ -- It's nice to have it in alphabetical order
+ for pref in pairs(view.value.permissions.value) do
+ prefixes[#prefixes + 1] = pref
end
- table.sort(actions)
- for y,act in pairs(actions) do
- print((html.html_escape(act)))
+ table.sort(prefixes)
+ for w,pref in ipairs(prefixes) do
+ local controllers = {}
+ -- Again, alphabetical order
+ for cont in pairs(view.value.permissions.value[pref]) do
+ controllers[#controllers + 1] = cont
+ end
+ table.sort(controllers)
+ for x,cont in ipairs(controllers) do
+ print("<TR><TD STYLE='font-weight:bold;'>",html.html_escape(pref..cont),"</TD><TD>")
+ -- Again, alphabetical order
+ local actions = {}
+ for act in pairs(view.value.permissions.value[pref][cont]) do
+ actions[#actions + 1] = act
+ end
+ table.sort(actions)
+ for y,act in pairs(actions) do
+ print((html.html_escape(act)))
+ end
+ io.write("<TD></TR>")
+ end
end
- io.write("<TD></TR>")
- end
- io.write("</TABLE>")
- %>
+ %>
+ </TABLE>
</DL>
<% end %>
-<% --]] %>