[Rt-commit] rt branch, 4.0/delete-delegation-acls, created. rt-4.0.1rc1-4-ge841aca

Kevin Falcone falcone at bestpractical.com
Wed May 25 19:38:51 EDT 2011


The branch, 4.0/delete-delegation-acls has been created
        at  e841acaac0448c9df710f889381645dc4bdcd3b4 (commit)

- Log -----------------------------------------------------------------
commit e841acaac0448c9df710f889381645dc4bdcd3b4
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Wed May 25 19:37:55 2011 -0400

    Remove *PersonalGroup and DelegateRight ACEs
    
    This stops the Admin UI from complaining about old deleted rights
    and finishes the cleanup that 3.9.2 and 4.0.1 were attempting to do
    anyway.

diff --git a/etc/upgrade/4.0.1/content b/etc/upgrade/4.0.1/content
index 6294ee8..86bf9e8 100644
--- a/etc/upgrade/4.0.1/content
+++ b/etc/upgrade/4.0.1/content
@@ -43,5 +43,23 @@
             $group->RT::Record::Delete();
         }
     },
+    sub {
+        use strict;
+        $RT::Logger->debug('Removing all Delegate and PersonalGroup rights');
+
+        my $acl = RT::ACL->new(RT->SystemUser);
+        for my $right (qw/AdminOwnPersonalGroups AdminAllPersonalGroups DelegateRights/) {
+            $acl->Limit( FIELD => 'RightName', VALUE => $right );
+        }
+
+        while ( my $ace = $acl->Next ) {
+            my ( $ok, $msg ) = $ace->Delete();
+            $RT::Logger->debug("Removing ACE ".$ace->id." for right ".$ace->__Value('RightName'));
+
+            if ( !$ok ) {
+                $RT::Logger->warn( "Unable to delete ACE " . $ace->id . ": " . $msg );
+            }
+        }
+    }
 );
 

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


More information about the Rt-commit mailing list