X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=rt%2Fshare%2Fhtml%2FAdmin%2FElements%2FSelectRights;h=73f5bced3f24a130bd2a486eb48e0d8d0b1343b3;hb=33beebf4cb42eba3e1dd868ad5e0af102de961da;hp=7ec8d1b42461752d270d2fdbd11e484baad86fcc;hpb=7ac86daf67b0a95153b736d5811f9050363f6553;p=freeside.git diff --git a/rt/share/html/Admin/Elements/SelectRights b/rt/share/html/Admin/Elements/SelectRights index 7ec8d1b42..73f5bced3 100755 --- a/rt/share/html/Admin/Elements/SelectRights +++ b/rt/share/html/Admin/Elements/SelectRights @@ -2,7 +2,7 @@ %# %# COPYRIGHT: %# -%# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +%# This software is Copyright (c) 1996-2012 Best Practical Solutions, LLC %# %# %# (Except where explicitly superseded by other copyright notices) @@ -95,21 +95,20 @@ while ( my $ace = $ACLObj->Next ) { } - my $ACLObj = new RT::ACL($session{'CurrentUser'}); - my $ACE = new RT::ACE($session{'CurrentUser'}); + my $ACLObj = RT::ACL->new($session{'CurrentUser'}); + my $ACE = RT::ACE->new($session{'CurrentUser'}); $ACLObj->LimitToObject( $Object); $ACLObj->LimitToPrincipal( Id => $PrincipalId); $ACLObj->OrderBy(FIELD=>'RightName'); - if (ref($Object) && UNIVERSAL::can($Object, 'AvailableRights')) { + eval { %Rights = %{$Object->AvailableRights}; - } - - else { - %Rights = ( loc('System Error') => loc("No rights found") ); - } + }; + if ($@) { + %Rights = ( loc('System Error') => loc("No rights found") ); + } $ACLDesc = "$PrincipalId-".ref($Object)."-".$Object->Id;