summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apk-available-html.lsp8
-rw-r--r--apk-details-html.lsp4
-rw-r--r--apk-expert-html.lsp8
-rw-r--r--apk-loaded-html.lsp14
4 files changed, 16 insertions, 18 deletions
diff --git a/apk-available-html.lsp b/apk-available-html.lsp
index 808a513..c2bdcb4 100644
--- a/apk-available-html.lsp
+++ b/apk-available-html.lsp
@@ -7,7 +7,7 @@
<DL>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
- <% if session.permissions.apk.install or session.permissions.apk.upgrade then %>
+ <% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD>
<% end %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Package Name</TD>
@@ -16,12 +16,12 @@
<% for i,packagetable in pairs(form.value) do %>
<TR>
- <% if session.permissions.apk.install or session.permissions.apk.upgrade then %>
+ <% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %>
<TD style="padding-right:20px;white-space:nowrap;">
- <% if session.permissions.apk.install and not packagetable.upgrade then %>
+ <% if viewlibrary.check_permission("install") and not packagetable.upgrade then %>
<%= html.link{value = "install?package=" .. packagetable.name, label="Install "} %>
<% end %>
- <% if session.permissions.apk.upgrade and packagetable.upgrade then %>
+ <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %>
<%= html.link{value = "upgrade?package=" .. packagetable.name, label="Upgrade "} %>
<% end %>
</TD>
diff --git a/apk-details-html.lsp b/apk-details-html.lsp
index 85e6925..8ec29c5 100644
--- a/apk-details-html.lsp
+++ b/apk-details-html.lsp
@@ -16,12 +16,12 @@ displayitem(data.value.size)
displayitem(data.value.upgrade)
%>
-<% if session.permissions[page_info.controller].install and data.value.installed.value == "" then %>
+<% if viewlibrary.check_permission("install") and data.value.installed.value == "" then %>
<DT>Install</DT>
<DD><form action="install" method="POST">
<input class="hidden" type="hidden" name="package" value=<%= data.value.package.value %>>
<input class="submit" type="submit" value="Install"></form></DD>
-<% elseif session.permissions[page_info.controller].upgrade and data.value.upgrade.value ~= "" then %>
+<% elseif viewlibrary.check_permission("upgrade") and data.value.upgrade.value ~= "" then %>
<DT>Upgrade</DT>
<DD><form action="upgrade" method="POST">
<input class="hidden" type="hidden" name="package" value=<%= data.value.package.value %>>
diff --git a/apk-expert-html.lsp b/apk-expert-html.lsp
index 9c92122..44b4b48 100644
--- a/apk-expert-html.lsp
+++ b/apk-expert-html.lsp
@@ -9,18 +9,16 @@ local func = haserl.loadfile(page_info.viewfile:gsub(pattern..".*$", "/") .. "fi
func(form, viewlibrary, page_info, session)
%>
-<% if session.permissions[page_info.controller].updateall or session.permissions[page_info.controller].upgradeall then %>
+<% if viewlibrary.check_permission("updateall") or viewlibrary.check_permission("upgradeall") then %>
<H2>Update / Upgrade</H2>
<DL>
-<% end %>
-<% if session.permissions[page_info.controller].updateall then %>
+<% if viewlibrary.check_permission("updateall") then %>
<DT>Update Index</DT>
<DD><form action="updateall" method="POST"><input class="submit" type="submit" value="Update"></form></DD>
<% end %>
-<% if session.permissions[page_info.controller].upgradeall then %>
+<% if viewlibrary.check_permission("upgradeall") then %>
<DT>Upgrade All</DT>
<DD><form action="upgradeall" method="POST"><input class="submit" type="submit" value="Upgrade"></form></DD>
<% end %>
-<% if session.permissions[page_info.controller].updateall or session.permissions[page_info.controller].upgradeall then %>
</DL>
<% end %>
diff --git a/apk-loaded-html.lsp b/apk-loaded-html.lsp
index d468e8a..1388ae2 100644
--- a/apk-loaded-html.lsp
+++ b/apk-loaded-html.lsp
@@ -8,7 +8,7 @@
<DL>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
- <% if session.permissions.apk.delete or session.permissions.apk.upgrade then %>
+ <% if viewlibrary.check_permission("delete") or viewlibrary.check_permission("upgrade") then %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD>
<% end %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Package Name</TD>
@@ -18,10 +18,10 @@
<% for i,packagetable in pairs(form.value.toplevel.value) do %>
<TR>
- <% if session.permissions.apk.delete then %>
+ <% if viewlibrary.check_permission("delete") then %>
<TD style="padding-right:20px;white-space:nowrap;">
<%= html.link{value = "delete?package=" .. packagetable.name, label="Delete "} %>
- <% if session.permissions.apk.upgrade and packagetable.upgrade then %>
+ <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %>
<%= html.link{value = "upgrade?package=" .. packagetable.name, label="Upgrade "} %>
<% end %>
</TD>
@@ -38,7 +38,7 @@
<DL>
<TABLE>
<TR style="background:#eee;font-weight:bold;">
- <% if session.permissions.apk.install or session.permissions.apk.upgrade then %>
+ <% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Action</TD>
<% end %>
<TD style="padding-right:20px;white-space:nowrap;" class="header">Package Name</TD>
@@ -48,12 +48,12 @@
<% for i,packagetable in pairs(form.value.dependent.value) do %>
<TR>
- <% if session.permissions.apk.install or session.permissions.apk.upgrade then %>
+ <% if viewlibrary.check_permission("install") or viewlibrary.check_permission("upgrade") then %>
<TD style="padding-right:20px;white-space:nowrap;">
- <% if session.permissions.apk.install then %>
+ <% if viewlibrary.check_permission("install") then %>
<%= html.link{value = "install?package=" .. packagetable.name, label="Promote "} %>
<% end %>
- <% if session.permissions.apk.upgrade and packagetable.upgrade then %>
+ <% if viewlibrary.check_permission("upgrade") and packagetable.upgrade then %>
<%= html.link{value = "upgrade?package=" .. packagetable.name, label="Upgrade "} %>
<% end %>
</TD>