From 3fc2855614b96451c99acd40e5083e5c8396dbb9 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Dec 2009 10:27:04 +0000 Subject: Use viewlibrary.check_permission from acf-core-0.9.0 --- tinydns-listfiles-html.lsp | 10 +++++----- tinydns-status-html.lsp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/tinydns-listfiles-html.lsp b/tinydns-listfiles-html.lsp index 72e3311..eab386f 100644 --- a/tinydns-listfiles-html.lsp +++ b/tinydns-listfiles-html.lsp @@ -18,10 +18,10 @@ require("viewfunctions") <% - if session.permissions[page_info.controller].delete then io.write(html.link{value = "delete?filename=" .. file.value.filename.value, label="Delete " }) end + if viewlibrary.check_permission("delete") then io.write(html.link{value = "delete?filename=" .. file.value.filename.value, label="Delete " }) end io.write(html.link{value = "view?filename=" .. file.value.filename.value, label="View " }) - if session.permissions[page_info.controller].edit then io.write(html.link{value = "edit?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end - if session.permissions[page_info.controller].editfile then io.write(html.link{value = "editfile?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Expert " }) end + if viewlibrary.check_permission("edit") then io.write(html.link{value = "edit?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end + if viewlibrary.check_permission("editfile") then io.write(html.link{value = "editfile?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Expert " }) end %> <%= html.html_escape(file.value.filesize.value) %> @@ -35,7 +35,7 @@ require("viewfunctions") <% end %> -<% if viewlibrary and viewlibrary.dispatch_component and session.permissions[page_info.controller].newfile then +<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("newfile") then local newfileform = viewlibrary.dispatch_component("newfile", nil, true) %>

Create new Domain

<% @@ -43,6 +43,6 @@ require("viewfunctions") displayform(newfileform) end %> -<% if viewlibrary and viewlibrary.dispatch_component and session.permissions[page_info.controller].startstop then +<% if viewlibrary and viewlibrary.dispatch_component and viewlibrary.check_permission("startstop") then viewlibrary.dispatch_component("startstop") end %> diff --git a/tinydns-status-html.lsp b/tinydns-status-html.lsp index efe77b8..49274e9 100644 --- a/tinydns-status-html.lsp +++ b/tinydns-status-html.lsp @@ -10,14 +10,14 @@ require("viewfunctions") displayitem(data.value.status) displayitem(data.value.version) -if data.value.version and data.value.version.errtxt and session.permissions.apk and session.permissions.apk.install then +if data.value.version and data.value.version.errtxt and viewlibrary.check_permission("apk-tools/apk/install") then %> Install <% end displayitem(data.value.autostart) -if not (data.value.version and data.value.version.errtxt) and data.value.autostart and data.value.autostart.errtxt and session.permissions.rc and session.permissions.rc.edit then +if not (data.value.version and data.value.version.errtxt) and data.value.autostart and data.value.autostart.errtxt and viewlibrary.check_permission("alpine-baselayout/rc/edit") then %> Schedule autostart <% -- cgit v1.2.3