[Bps-public-commit] rt-extension-rightsdebugger branch, master, updated. a845de52dff2231b732fac14d988b71250389553
Shawn Moore
shawn at bestpractical.com
Thu Feb 2 17:17:27 EST 2017
The branch, master has been updated
via a845de52dff2231b732fac14d988b71250389553 (commit)
from dc11ac23ebc6944765c2ce1c77d6128e6cae5206 (commit)
Summary of changes:
META.yml | 1 +
html/Admin/RightsDebugger/index.html | 8 ++++++++
html/Callbacks/RightsDebugger/Elements/Tabs/Privileged | 10 ++++++++++
3 files changed, 19 insertions(+)
create mode 100644 html/Admin/RightsDebugger/index.html
create mode 100644 html/Callbacks/RightsDebugger/Elements/Tabs/Privileged
- Log -----------------------------------------------------------------
commit a845de52dff2231b732fac14d988b71250389553
Author: Shawn M Moore <shawn at bestpractical.com>
Date: Thu Feb 2 22:17:17 2017 +0000
Add menu item and empty landing page
diff --git a/META.yml b/META.yml
index 9f6ba95..2c98179 100644
--- a/META.yml
+++ b/META.yml
@@ -16,6 +16,7 @@ meta-spec:
name: RT-Extension-RightsDebugger
no_index:
directory:
+ - html
- inc
requires:
perl: 5.10.1
diff --git a/html/Admin/RightsDebugger/index.html b/html/Admin/RightsDebugger/index.html
new file mode 100644
index 0000000..6ece378
--- /dev/null
+++ b/html/Admin/RightsDebugger/index.html
@@ -0,0 +1,8 @@
+<& /Admin/Elements/Header, Title => loc("Rights Debugger") &>
+<& /Elements/Tabs &>
+
+<%INIT>
+unless ($session{'CurrentUser'}->HasRight( Object=> RT->System, Right => 'SuperUser')) {
+ Abort(loc('This feature is only available to system administrators.'));
+}
+</%INIT>
diff --git a/html/Callbacks/RightsDebugger/Elements/Tabs/Privileged b/html/Callbacks/RightsDebugger/Elements/Tabs/Privileged
new file mode 100644
index 0000000..b30fb36
--- /dev/null
+++ b/html/Callbacks/RightsDebugger/Elements/Tabs/Privileged
@@ -0,0 +1,10 @@
+<%INIT>
+return unless $session{'CurrentUser'}->HasRight( Object=> RT->System, Right => 'SuperUser');
+
+my $tools = Menu->child('admin')->child('tools');
+
+my $rights = $tools->child( rights_debugger =>
+ title => loc('Rights Debugger'),
+ path => '/Admin/RightsDebugger/',
+);
+</%INIT>
-----------------------------------------------------------------------
More information about the Bps-public-commit
mailing list