fixed locking bug

This commit is contained in:
JT Smith 2006-03-20 21:53:14 +00:00
parent 3931d8dcd2
commit b062e61508
4 changed files with 10 additions and 10 deletions

View file

@ -80,14 +80,14 @@ sub addRevision {
=head2 canEditIfLocked ( )
Returns a boolean indicating whether this asset is locked and if the current user can edit it in that state.
Returns 1 if it's not locked. Returns 1 if is locked, and the user is using the tag it was edited under. Otherwise returns 0.
=cut
sub canEditIfLocked {
my $self = shift;
return 0 unless ($self->isLocked);
return ($self->get("isLockedBy") eq $self->session->user->userId);
return 1 unless ($self->isLocked);
return ($self->session->scratch->get("versionTag") eq $self->get("tagId"));
}