fixed: User who can approve version tag no longer sees Permission Denied after they've approved
This commit is contained in:
parent
1e9b0277e3
commit
483bdd441f
3 changed files with 41 additions and 5 deletions
|
|
@ -19,6 +19,10 @@
|
|||
- Added more information about workflow instance errors, so we can debug without having
|
||||
to watch SPECTRE's debug output.
|
||||
- fixed: List style Content profile fields broken
|
||||
- Added additional error messages
|
||||
- fixed: Added a friendly message so when a user who approves a version tag,
|
||||
but cannot view the version tag (is not in Turn Admin On group), they do
|
||||
not see "Permission Denied"
|
||||
|
||||
7.5.15
|
||||
- fixed: Colorpicker window would not open (Martin Kamerbeek / Oqapi)
|
||||
|
|
|
|||
|
|
@ -159,20 +159,33 @@ sub www_approveVersionTag {
|
|||
my $instance = $tag->getWorkflowInstance;
|
||||
my $activity = $instance->getNextActivity;
|
||||
|
||||
if ( $session->form->process("status", "selectBox") eq "approve" ) {
|
||||
my $approve = $session->form->process( "status", "selectBox" ) eq "approve";
|
||||
if ( $approve ) {
|
||||
$activity->setApproved( $instance );
|
||||
}
|
||||
}
|
||||
else {
|
||||
$activity->setDenied( $instance );
|
||||
}
|
||||
}
|
||||
|
||||
$tag->set( {
|
||||
comments => $session->form->process("comments", "textarea"),
|
||||
});
|
||||
});
|
||||
|
||||
return www_manageVersions($session);
|
||||
# If we can't view the version tag after this, show a different message
|
||||
if ( !canViewVersionTag( $session, $tag ) ) {
|
||||
my $i18n = WebGUI::International->new( $session, "VersionTag" );
|
||||
return $session->style->userStyle(
|
||||
sprintf $i18n->get( 'approveVersionTag message' ),
|
||||
( $approve ? $i18n->get( "approved" ) : $i18n->get( "denied" ) ),
|
||||
$session->url->getBackToSiteURL,
|
||||
);
|
||||
}
|
||||
else {
|
||||
return www_manageVersions($session);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#-------------------------------------------------------------------
|
||||
|
||||
=head2 www_editVersionTag ( session, [ tagId ] )
|
||||
|
|
@ -706,6 +719,8 @@ sub www_manageRevisionsInTag {
|
|||
);
|
||||
|
||||
# Output the revisions
|
||||
### FIXME: Users who only pass canApproveVersionTag() and not canViewVersionTag() should
|
||||
# probably not be allowed to see the Actions or modify the Start and End dates
|
||||
$output
|
||||
.= WebGUI::Form::formHeader( $session, {} )
|
||||
. WebGUI::Form::hidden( $session, { name => 'op', value=> 'manageRevisionsInTag' } )
|
||||
|
|
|
|||
|
|
@ -436,7 +436,24 @@ our $I18N = {
|
|||
message => q|End Time|,
|
||||
lastUpdated => 1148360141,
|
||||
},
|
||||
|
||||
'approved' => {
|
||||
message => q{approved},
|
||||
lastUpdated => 0,
|
||||
context => 'Status of version tag',
|
||||
},
|
||||
|
||||
'denied' => {
|
||||
message => q{denied},
|
||||
lastUpdated => 0,
|
||||
context => 'Status of version tag',
|
||||
},
|
||||
|
||||
'approveVersionTag message' => {
|
||||
message => q{Your version tag has been %s. <a href="%s">Back to site</a>.},
|
||||
lastUpdated => 0,
|
||||
context => q{Message for when someone approves a version tag},
|
||||
},
|
||||
};
|
||||
|
||||
1;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue