[Rt-commit] rt branch, 4.2/remove-role-acl, created. rt-4.2.2-82-gf148970

Alex Vandiver alexmv at bestpractical.com
Fri Feb 14 11:32:06 EST 2014


The branch, 4.2/remove-role-acl has been created
        at  f1489708608b338b907aef03da9498688d408161 (commit)

- Log -----------------------------------------------------------------
commit 5ee05d85914ee09720aef5652bfa6793b70153db
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Feb 14 01:21:50 2014 -0500

    Pass the role type to the ACL method, as AddRoleMember does
    
    This caused failures in removing watchers from tickets, when the remover
    only had Watch / WatchAsAcminCc.
    
    This is now also consistent with how all existing _HasModifyWatcherRight
    methods (the only functions currently passed for ACL) expect to be
    called.

diff --git a/lib/RT/Record/Role/Roles.pm b/lib/RT/Record/Role/Roles.pm
index a6172b4..ac7e0c2 100644
--- a/lib/RT/Record/Role/Roles.pm
+++ b/lib/RT/Record/Role/Roles.pm
@@ -483,7 +483,7 @@ sub DeleteRoleMember {
 
     my $acl = delete $args{ACL};
     return (0, $self->loc("Permission denied"))
-        if $acl and not $acl->($principal);
+        if $acl and not $acl->($args{Type} => $principal);
 
     my $group = $self->RoleGroup( $args{Type} );
     return (0, $self->loc("Role group '[_1]' not found", $args{Type}))

commit f1489708608b338b907aef03da9498688d408161
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Fri Feb 14 01:24:23 2014 -0500

    Document the ACL argument, as AddRoleMember does

diff --git a/lib/RT/Record/Role/Roles.pm b/lib/RT/Record/Role/Roles.pm
index ac7e0c2..c1e03fd 100644
--- a/lib/RT/Record/Role/Roles.pm
+++ b/lib/RT/Record/Role/Roles.pm
@@ -451,6 +451,12 @@ principal
 
 Required.  One of the valid roles for this record, as returned by L</Roles>.
 
+=item ACL
+
+Optional.  A subroutine reference which will be passed the role type and
+principal being removed.  If it returns false, the method will fail with a
+status of "Permission denied".
+
 =back
 
 One, and only one, of I<PrincipalId> or I<User> is required.

-----------------------------------------------------------------------


More information about the rt-commit mailing list