- my $right = shift;
-
- my $equiv = [ $RT::System ];
- if ($self->ObjectId) {
- my $obj = $self->ObjectType->new($self->CurrentUser);
- $obj->Load($self->ObjectId);
- push @{$equiv}, $obj;
- }
- if ($self->Id) {
- return ( $self->CurrentUser->HasRight(
- Right => $right,
- Object => $self,
- EquivObjects => $equiv,
- ) );
- } else {
- # If we don't have an ID, we don't even know what object we're
- # attached to -- so the only thing we can fall back on is the
- # system object.
- return ( $self->CurrentUser->HasRight(
- Right => $right,
- Object => $RT::System,
- ) );
- }
-