From 7b4ec470fa2e95cfcb1d2c5244f940acbf4ec0f6 Mon Sep 17 00:00:00 2001 From: Ted Trask Date: Thu, 17 Dec 2009 10:28:01 +0000 Subject: Use viewlibrary.check_permission from acf-core-0.9.0 --- rrdtool-expert-html.lsp | 2 +- rrdtool-listgraphcfg-html.lsp | 15 ++++----------- rrdtool-listrrd-html.lsp | 17 +++++------------ 3 files changed, 10 insertions(+), 24 deletions(-) diff --git a/rrdtool-expert-html.lsp b/rrdtool-expert-html.lsp index 6cbb910..c983b88 100644 --- a/rrdtool-expert-html.lsp +++ b/rrdtool-expert-html.lsp @@ -20,6 +20,6 @@ local func = haserl.loadfile(page_info.viewfile:gsub(pattern..".*$", "/") .. "fi func(form, viewlibrary, page_info, session) %> -<% 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/rrdtool-listgraphcfg-html.lsp b/rrdtool-listgraphcfg-html.lsp index d415675..83be263 100644 --- a/rrdtool-listgraphcfg-html.lsp +++ b/rrdtool-listgraphcfg-html.lsp @@ -1,13 +1,6 @@ <% local form, viewlibrary, page_info, session = ... require("viewfunctions") %> -<% ---[[ DEBUG INFORMATION -io.write("

DEBUGGING

DEBUG INFO: CFE

") -io.write(html.cfe_unpack(form)) -io.write("
") ---]] -%> <% displaycommandresults({"delete"}, session) %> @@ -35,11 +28,11 @@ function javascript_confirm_graph(formID,filename) { <% for i,file in ipairs(form.value) do %> - <% if session.permissions[page_info.controller].delete then %> + <% if viewlibrary.check_permission("delete") then %> Delete <% end %> <% - if session.permissions[page_info.controller].editgraphcfg then io.write(html.link{value = "editgraphcfg?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end + if viewlibrary.check_permission("editgraphcfg") then io.write(html.link{value = "editgraphcfg?filename=" .. file.value.filename.value.."&redir="..page_info.orig_action, label="Edit " }) end %> <%= html.html_escape(file.value.filesize.value) %> @@ -48,7 +41,7 @@ function javascript_confirm_graph(formID,filename) { <% end %> - <% if session.permissions[page_info.controller].createrrd then %> + <% if viewlibrary.check_permission("createrrd") then %> <% io.write(html.link{value = "newgraphcfg", label="Create new graph " }) %> @@ -59,7 +52,7 @@ function javascript_confirm_graph(formID,filename) { -<% 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

<% diff --git a/rrdtool-listrrd-html.lsp b/rrdtool-listrrd-html.lsp index 379e55a..dff97a8 100644 --- a/rrdtool-listrrd-html.lsp +++ b/rrdtool-listrrd-html.lsp @@ -1,13 +1,6 @@ <% local form, viewlibrary, page_info, session = ... require("viewfunctions") %> -<% ---[[ DEBUG INFORMATION -io.write("

DEBUGGING

DEBUG INFO: CFE

") -io.write(html.cfe_unpack(form)) -io.write("
") ---]] -%>