Commit 3475a111 authored by Shawn M Moore's avatar Shawn M Moore
Browse files

s/ExecutePerl/ExecuteCode/g

parent b6bd18b1
......@@ -25,7 +25,7 @@
},
sub {
use strict;
$RT::Logger->debug('Adding ExecutePerl right to principals that currently have ModifyTemplate');
$RT::Logger->debug('Adding ExecuteCode right to principals that currently have ModifyTemplate');
my $acl = RT::ACL->new($RT::SystemUser);
$acl->Limit(
......@@ -38,12 +38,12 @@
my $principal = $ace->PrincipalObj;
my ($ok, $msg) = $principal->GrantRight(
Right => 'ExecutePerl',
Right => 'ExecuteCode',
Object => $RT::SystemUser,
);
if (!$ok) {
$RT::Logger->warn("Unable to grant ExecutePerl on principal " . $principal->id . ": $msg");
$RT::Logger->warn("Unable to grant ExecuteCode on principal " . $principal->id . ": $msg");
}
}
},
......
......@@ -108,7 +108,7 @@ sub Create {
if (length($args{CustomPrepareCode}) || length($args{CustomCommitCode}) || length($args{CustomIsApplicableCode})) {
unless ( $self->CurrentUser->HasRight( Object => $RT::System,
Right => 'ExecutePerl' ) )
Right => 'ExecuteCode' ) )
{
return ( 0, $self->loc('Permission Denied') );
}
......@@ -527,7 +527,7 @@ sub _Set {
if (length($args{Value})) {
if ($args{Field} eq 'CustomIsApplicableCode' || $args{Field} eq 'CustomPrepareCode' || $args{Field} eq 'CustomCommitCode') {
unless ( $self->CurrentUser->HasRight( Object => $RT::System,
Right => 'ExecutePerl' ) ) {
Right => 'ExecuteCode' ) ) {
return ( 0, $self->loc('Permission Denied') );
}
}
......
......@@ -89,7 +89,7 @@ our $RIGHTS = {
ShowApprovalsTab => "show Approvals tab", # loc_pair
LoadSavedSearch => "allow loading of saved searches", # loc_pair
CreateSavedSearch => "allow creation of saved searches", # loc_pair
ExecutePerl => "allow writing Perl code in templates, scrips, etc", # loc_pair
ExecuteCode => "allow writing Perl code in templates, scrips, etc", # loc_pair
};
# Tell RT::ACE that this sort of object can get acls granted
......
......@@ -211,7 +211,7 @@ sub Create {
@_
);
if ( $args{Type} eq 'Perl' && !$self->CurrentUser->HasRight(Right => 'ExecutePerl', Object => $RT::System) ) {
if ( $args{Type} eq 'Perl' && !$self->CurrentUser->HasRight(Right => 'ExecuteCode', Object => $RT::System) ) {
return ( undef, $self->loc('Permission Denied') );
}
......@@ -595,7 +595,7 @@ sub CurrentUserHasQueueRight {
=head2 SetType
If setting Type to Perl, require the ExecutePerl right.
If setting Type to Perl, require the ExecuteCode right.
=cut
......@@ -603,7 +603,7 @@ sub SetType {
my $self = shift;
my $NewType = shift;
if ($NewType eq 'Perl' && !$self->CurrentUser->HasRight(Right => 'ExecutePerl', Object => $RT::System)) {
if ($NewType eq 'Perl' && !$self->CurrentUser->HasRight(Right => 'ExecuteCode', Object => $RT::System)) {
return ( undef, $self->loc('Permission Denied') );
}
......
......@@ -47,17 +47,17 @@ $m->submit;
$m->title_is(q{Modify template Resolved}, 'modifying the Resolved template');
$m->form_name('ModifyTemplate');
is($m->value('Type'), 'Simple', 'need the ExecutePerl right to update Type to Perl');
is($m->value('Type'), 'Simple', 'need the ExecuteCode right to update Type to Perl');
$m->content_contains('Permission Denied');
ok( RT::Test->add_rights(
{ Principal => $user_a, Right => [qw(ExecutePerl)] },
), 'add ExecutePerl rights');
{ Principal => $user_a, Right => [qw(ExecuteCode)] },
), 'add ExecuteCode rights');
$m->field(Type => 'Perl');
$m->submit;
$m->title_is(q{Modify template Resolved}, 'modifying the Resolved template');
$m->form_name('ModifyTemplate');
is($m->value('Type'), 'Perl', 'now that we have ExecutePerl we can update Type to Perl');
is($m->value('Type'), 'Perl', 'now that we have ExecuteCode we can update Type to Perl');
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