Commit d2ff490e authored by Ruslan Zakirov's avatar Ruslan Zakirov
Browse files

add protection by a right

parent c837fc55
......@@ -8,7 +8,7 @@ build_requires:
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
......
......@@ -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',
......
......@@ -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;
......
......@@ -316,6 +316,14 @@ Just grant them ModifyCustomField right.
=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';
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment