Commit 193b6894 authored by Shawn M Moore's avatar Shawn M Moore
Browse files

Make sure people without ExecuteCode can't update Content when template is Perl

    Ferreted out by an upcoming test file
parent 8e08c4e4
......@@ -611,6 +611,23 @@ sub SetType {
return $self->_Set( Field => 'Type', Value => $NewType );
}
=head2 SetContent
If changing content and the type is Perl, require the ExecuteCode right.
=cut
sub SetContent {
my $self = shift;
my $NewContent = shift;
if ($self->Type eq 'Perl' && !$self->CurrentUser->HasRight(Right => 'ExecuteCode', Object => $RT::System)) {
return ( undef, $self->loc('Permission Denied') );
}
return $self->_Set( Field => 'Content', Value => $NewContent );
}
sub _UpdateAttributes {
my $self = shift;
my %args = (
......
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