[Rt-commit] rt branch, 4.0/simple-template-permission, created. rt-4.0.6-217-g1a7e87b
Alex Vandiver
alexmv at bestpractical.com
Thu Jun 21 19:48:35 EDT 2012
The branch, 4.0/simple-template-permission has been created
at 1a7e87b7083a995c0040fd317e0ee65c4ac46ba6 (commit)
- Log -----------------------------------------------------------------
commit c32d728a0f56d7a42e054e710c2abfd91d7230d2
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Thu Jun 21 19:24:14 2012 -0400
Allow non-ExecuteCode users to create Simple templates
Previously, the type was set after creation time; but only users with
ExecuteCode are allowed to create Perl templates, making it effectively
impossible for non-ExecuteCode users to create new templates, even
Simple ones.
Pass the type of the template at Create time, making this into an
operation that such users have permission to do.
Submitted-by: Tim Cutts <tjrc at sanger.ac.uk>
diff --git a/share/html/Admin/Global/Template.html b/share/html/Admin/Global/Template.html
index 70b6905..6d62ded 100755
--- a/share/html/Admin/Global/Template.html
+++ b/share/html/Admin/Global/Template.html
@@ -80,7 +80,7 @@ if ($Create) {
else {
if (defined ($Template) && $Template eq 'new') {
- my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name);
+ my ($val, $msg) = $TemplateObj->Create(Queue => $Queue, Name => $Name, Type => $Type);
Abort(loc("Could not create template: [_1]", $msg)) unless ($val);
push @results, $msg;
}
@@ -108,4 +108,5 @@ $Queue => ''
$Template => ''
$Create => ''
$Name => ''
+$Type => ''
</%ARGS>
diff --git a/share/html/Admin/Queues/Template.html b/share/html/Admin/Queues/Template.html
index 3dd99e1..c9d8abc 100755
--- a/share/html/Admin/Queues/Template.html
+++ b/share/html/Admin/Queues/Template.html
@@ -79,7 +79,7 @@ my @results;
if ( !$Create ) {
if ( $Template eq 'new' ) {
my ( $val, $msg )
- = $TemplateObj->Create( Queue => $Queue, Name => $Name );
+ = $TemplateObj->Create( Queue => $Queue, Name => $Name, Type => $Type );
Abort( loc( "Could not create template: [_1]", $msg ) ) unless ($val);
push @results, $msg;
} else {
@@ -121,4 +121,5 @@ $Queue => ''
$Template => ''
$Create => undef
$Name => undef
+$Type => undef
</%ARGS>
commit 1a7e87b7083a995c0040fd317e0ee65c4ac46ba6
Author: Alex Vandiver <alexmv at bestpractical.com>
Date: Thu Jun 21 19:38:36 2012 -0400
Allow altering template type to Simple and changing Content simultaneously
The order in of the array passed to AttributesRef determines the order
in which updates are applied. Because Content denies updates if the
current Type is 'Perl' and the user doesn't have ExecuteCode, this means
that it was impossible for such a user to update the Content in the same
submission as the type was changed to Simple. Reorder the AttributesRef
such that Type comes before Content, thus ensuring that the ACL
surrounding Content will be satisfied by the time we attempt to update
it.
diff --git a/share/html/Admin/Global/Template.html b/share/html/Admin/Global/Template.html
index 6d62ded..be8501b 100755
--- a/share/html/Admin/Global/Template.html
+++ b/share/html/Admin/Global/Template.html
@@ -92,7 +92,7 @@ else {
}
if ($TemplateObj->Id()) {
- my @attribs = qw( Description Content Queue Name Type );
+ my @attribs = qw( Name Description Queue Type Content );
my @aresults = UpdateRecordObject( AttributesRef => \@attribs,
Object => $TemplateObj,
ARGSRef => \%ARGS);
diff --git a/share/html/Admin/Queues/Template.html b/share/html/Admin/Queues/Template.html
index c9d8abc..a4c1950 100755
--- a/share/html/Admin/Queues/Template.html
+++ b/share/html/Admin/Queues/Template.html
@@ -92,7 +92,7 @@ if ( $TemplateObj->Id() ) {
$Queue = $TemplateObj->Queue;
$QueueObj = $TemplateObj->QueueObj;
- my @attribs = qw( Description Content Queue Name Type );
+ my @attribs = qw( Name Description Queue Type Content );
my @aresults = UpdateRecordObject( AttributesRef => \@attribs,
Object => $TemplateObj,
ARGSRef => \%ARGS
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list