[Rt-commit] r18358 - rt/3.8/trunk/lib/RT

ruz at bestpractical.com ruz at bestpractical.com
Thu Feb 12 18:51:59 EST 2009


Author: ruz
Date: Thu Feb 12 18:51:58 2009
New Revision: 18358

Modified:
   rt/3.8/trunk/lib/RT/Principal_Overlay.pm

Log:
* don't check right in GrantRight as ACE->Create does better job

Modified: rt/3.8/trunk/lib/RT/Principal_Overlay.pm
==============================================================================
--- rt/3.8/trunk/lib/RT/Principal_Overlay.pm	(original)
+++ rt/3.8/trunk/lib/RT/Principal_Overlay.pm	Thu Feb 12 18:51:58 2009
@@ -152,29 +152,25 @@
 
 sub GrantRight {
     my $self = shift;
-    my %args = ( Right => undef,
-                Object => undef,
-                @_);
-
-
-    unless ($args{'Right'}) {
-        return(0, $self->loc("Invalid Right"));
-    }
-
+    my %args = (
+        Right => undef,
+        Object => undef,
+        @_
+    );
 
     #ACL check handled in ACE.pm
     my $ace = RT::ACE->new( $self->CurrentUser );
 
-
     my $type = $self->_GetPrincipalTypeForACL();
 
     # If it's a user, we really want to grant the right to their 
     # user equivalence group
-        return ( $ace->Create(RightName => $args{'Right'},
-                          Object => $args{'Object'},
-                          PrincipalType =>  $type,
-                          PrincipalId => $self->Id
-                          ) );
+    return $ace->Create(
+        RightName     => $args{'Right'},
+        Object        => $args{'Object'},
+        PrincipalType => $type,
+        PrincipalId   => $self->Id,
+    );
 }
 # }}}
 


More information about the Rt-commit mailing list