diff --git a/lib/WebGUI/Session/Privilege.pm b/lib/WebGUI/Session/Privilege.pm index 227e262e0..10827cfc3 100644 --- a/lib/WebGUI/Session/Privilege.pm +++ b/lib/WebGUI/Session/Privilege.pm @@ -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 = '

'.$i18n->get(37).'

'; + if ($noStyle) { + $self->session->style->useEmptyStyle(1); + $output .= $i18n->get('asset locked'); + } + else { + $output .= $i18n->get('asset locked'); + } + return $self->session->style->userStyle($output); +} + + #------------------------------------------------------------------- diff --git a/lib/WebGUI/i18n/English/WebGUI.pm b/lib/WebGUI/i18n/English/WebGUI.pm index 0512658d0..dce46c7b0 100644 --- a/lib/WebGUI/i18n/English/WebGUI.pm +++ b/lib/WebGUI/i18n/English/WebGUI.pm @@ -3298,6 +3298,11 @@ or are under your current version tag.

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 diff --git a/t/Session/Privilege.t b/t/Session/Privilege.t index 6c2042002..156864cd1 100644 --- a/t/Session/Privilege.t +++ b/t/Session/Privilege.t @@ -32,6 +32,12 @@ my @simpleTests = ( description => 'Insufficient Privileges', titleCode => 37, }, + { + method => 'locked', + status => 401, + description => 'Insufficient Privileges', + titleCode => 37, + }, { method => 'notMember', status => 400,