[Bps-public-commit] r19653 - in RT-Extension-SLA: html/Callbacks/RT-Extension-SLA/Tools/Reports/Elements/Tabs html/Tools/Reports lib/RT/Extension

ruz at bestpractical.com ruz at bestpractical.com
Wed May 13 17:58:49 EDT 2009


Author: ruz
Date: Wed May 13 17:58:49 2009
New Revision: 19653

Modified:
   RT-Extension-SLA/META.yml
   RT-Extension-SLA/html/Callbacks/RT-Extension-SLA/Tools/Reports/Elements/Tabs/Default
   RT-Extension-SLA/html/Tools/Reports/SLA.html
   RT-Extension-SLA/lib/RT/Extension/SLA.pm

Log:
* add protection by a right

Modified: RT-Extension-SLA/META.yml
==============================================================================
--- RT-Extension-SLA/META.yml	(original)
+++ RT-Extension-SLA/META.yml	Wed May 13 17:58:49 2009
@@ -8,7 +8,7 @@
 configure_requires:
   ExtUtils::MakeMaker: 6.42
 distribution_type: module
-generated_by: 'Module::Install version 0.85'
+generated_by: 'Module::Install version 0.87'
 license: gpl2
 meta-spec:
   url: http://module-build.sourceforge.net/META-spec-v1.4.html

Modified: RT-Extension-SLA/html/Callbacks/RT-Extension-SLA/Tools/Reports/Elements/Tabs/Default
==============================================================================
--- RT-Extension-SLA/html/Callbacks/RT-Extension-SLA/Tools/Reports/Elements/Tabs/Default	(original)
+++ RT-Extension-SLA/html/Callbacks/RT-Extension-SLA/Tools/Reports/Elements/Tabs/Default	Wed May 13 17:58:49 2009
@@ -2,6 +2,9 @@
 $tabs => {}
 </%ARGS>
 <%INIT>
+return unless $session{'CurrentUser'}->PrincipalObj->HasRight(
+    Object => $RT::System, Right => 'SeeSLAReports',
+);
 $tabs->{'s'} = {
     title => loc('Service Level Aggreements'),
     path  => 'Tools/Reports/SLA.html',

Modified: RT-Extension-SLA/html/Tools/Reports/SLA.html
==============================================================================
--- RT-Extension-SLA/html/Tools/Reports/SLA.html	(original)
+++ RT-Extension-SLA/html/Tools/Reports/SLA.html	Wed May 13 17:58:49 2009
@@ -33,6 +33,14 @@
 $Query => undef
 </%ARGS>
 <%INIT>
+unless (
+    $session{'CurrentUser'}->PrincipalObj->HasRight(
+        Object => $RT::System, Right => 'SeeSLAReports',
+    )
+) {
+    Abort("You're not allowed to see SLA reports.");
+}
+
 my $title = loc("Report on Service Level Agreements");
 
 use RT::Extension::SLA::Summary;

Modified: RT-Extension-SLA/lib/RT/Extension/SLA.pm
==============================================================================
--- RT-Extension-SLA/lib/RT/Extension/SLA.pm	(original)
+++ RT-Extension-SLA/lib/RT/Extension/SLA.pm	Wed May 13 17:58:49 2009
@@ -316,6 +316,14 @@
 
 =cut
 
+{
+    my $right = 'SeeSLAReports';
+    use RT::System;
+    $RT::System::Rights->{$right} = 'See service level performance reports';
+    use RT::ACE;
+    $RT::ACE::LOWERCASERIGHTNAMES{ lc $right } = $right;
+}
+
 sub BusinessHours {
     my $self = shift;
     my $name = shift || 'Default';



More information about the Bps-public-commit mailing list