add another privilege method for handling locked assets

This commit is contained in:
Colin Kuskie 2007-04-27 22:20:27 +00:00
parent 58018d5d69
commit 38060cc0cb
3 changed files with 37 additions and 0 deletions

View file

@ -102,6 +102,32 @@ sub insufficient {
return $self->session->style->userStyle($output);
}
#-------------------------------------------------------------------
=head2 locked ( )
Returns a message stating that Asset is locked. This is a variation of insufficient with
a different error message.
=cut
sub locked {
my $self = shift;
my $noStyle = shift;
my $i18n = WebGUI::International->new($self->session);
$self->session->http->setStatus("401", "Insufficient Privileges");
my $output = '<h1>'.$i18n->get(37).'</h1>';
if ($noStyle) {
$self->session->style->useEmptyStyle(1);
$output .= $i18n->get('asset locked');
}
else {
$output .= $i18n->get('asset locked');
}
return $self->session->style->userStyle($output);
}
#-------------------------------------------------------------------

View file

@ -3298,6 +3298,11 @@ or are under your current version tag.</p>
lastUpdated => 1031514049
},
'asset locked' => {
message => q|This Asset is locked for editing under a version tag different from the one that you are using.|,
lastUpdated => 1177706405
},
'bare insufficient' => {
message => q|You do not have sufficient privileges to perform this operation. Please log in with an account that has sufficient privileges before attempting this operation.|,
lastUpdated => 1169790230

View file

@ -32,6 +32,12 @@ my @simpleTests = (
description => 'Insufficient Privileges',
titleCode => 37,
},
{
method => 'locked',
status => 401,
description => 'Insufficient Privileges',
titleCode => 37,
},
{
method => 'notMember',
status => 400,