starting to work...
[freeside.git] / rt / share / html / Admin / Elements / SelectRights
index 7ec8d1b..73f5bce 100755 (executable)
@@ -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
 %#                                          <sales@bestpractical.com>
 %#
 %# (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;
 </%INIT>