diff options
Diffstat (limited to 'perl')
-rw-r--r-- | perl/Wallet/Server.pm | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/perl/Wallet/Server.pm b/perl/Wallet/Server.pm index 172cdf1..2bc6ba1 100644 --- a/perl/Wallet/Server.pm +++ b/perl/Wallet/Server.pm @@ -24,7 +24,7 @@ use Wallet::Schema; # This version should be increased on any code change to this module. Always # use two digits for the minor version with a leading zero if necessary so # that it will sort properly. -$VERSION = '0.01'; +$VERSION = '0.02'; # This is a mapping of object types to class names, used to determine which # object implementation should be instantiated for a given object type. @@ -375,6 +375,19 @@ sub show { return $result; } +# Return a human-readable description of the object history, or returns undef +# and sets the internal error if the object can't be found or if the user +# isn't authorized. +sub history { + my ($self, $type, $name) = @_; + my $object = $self->retrieve ($type, $name); + return undef unless defined $object; + return undef unless $self->acl_check ($object, 'show'); + my $result = $object->history; + $self->error ($object->error) unless defined $result; + return $result; +} + # Destroys the object, or returns undef and sets the internal error if the # object can't be found or if the user isn't authorized. sub destroy { @@ -801,6 +814,14 @@ special privileges to get objects. Returns undef on failure. The caller should be careful to distinguish between undef and the empty string, which is valid object data. +=item history(TYPE, NAME) + +Returns (as a string) the human-readable history of the object identified by +TYPE and NAME, or undef on error. To see the object history, the current +user must be a member of the ADMIN ACL, authorized by the show ACL, or +authorized by the owner ACL; however, if the show ACL is set, the owner ACL +will not be checked. + =item owner(TYPE, NAME [, OWNER]) Gets or sets the owner for the object identified by TYPE and NAME. If OWNER |