#
# COPYRIGHT:
#
-# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC
+# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
# <sales@bestpractical.com>
#
# (Except where explicitly superseded by other copyright notices)
CustomPrepareCode => undef,
CustomCommitCode => undef,
CustomIsApplicableCode => undef,
+ ConditionRules => undef,
+ ActionRules => undef,
@_
);
CustomPrepareCode => $args{'CustomPrepareCode'},
CustomCommitCode => $args{'CustomCommitCode'},
CustomIsApplicableCode => $args{'CustomIsApplicableCode'},
+ ConditionRules => $args{'ConditionRules'},
+ ActionRules => $args{'ActionRules'},
);
if ( $id ) {
return ( $id, $self->loc('Scrip Created') );
# does an acl check and then passes off the call
sub _Set {
my $self = shift;
+ my %args = (
+ Field => undef,
+ Value => undef,
+ @_,
+ );
unless ( $self->CurrentUserHasRight('ModifyScrips') ) {
$RT::Logger->debug(
"CurrentUser can't modify Scrips for " . $self->Queue . "\n" );
return ( 0, $self->loc('Permission Denied') );
}
+
+ if (exists $args{Value}) {
+ if ($args{Field} eq 'Queue') {
+ if ($args{Value}) {
+ # moving to another queue
+ my $queue = RT::Queue->new( $self->CurrentUser );
+ $queue->Load($args{Value});
+ unless ($queue->Id and $queue->CurrentUserHasRight('ModifyScrips')) {
+ return ( 0, $self->loc('Permission Denied') );
+ }
+ } else {
+ # moving to global
+ unless ($self->CurrentUser->HasRight( Object => RT->System, Right => 'ModifyScrips' )) {
+ return ( 0, $self->loc('Permission Denied') );
+ }
+ }
+ }
+ elsif ($args{Field} eq 'Template') {
+ my $template = RT::Template->new( $self->CurrentUser );
+ $template->Load($args{Value});
+ unless ($template->Id and $template->CurrentUserHasQueueRight('ShowTemplate')) {
+ return ( 0, $self->loc('Permission Denied') );
+ }
+ }
+ }
return $self->__Set(@_);
}