Revert r38427 "Create User::getGroupsInRoles(). Given an array of roles (edit, read...
authorBrion Vibber <brion@users.mediawiki.org>
Mon, 4 Aug 2008 03:45:22 +0000 (03:45 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Mon, 4 Aug 2008 03:45:22 +0000 (03:45 +0000)
This seems a bit odd; the name is certainly confusing -- getGroupsWithPermissions() would be clearer, but I'm not really sure I see why it's given an arbitrary-length list here (vs a simpler single check which can simply be run multiple times).

includes/User.php

index 09326cc..5c12981 100644 (file)
@@ -2767,23 +2767,6 @@ class User {
                }
                return $rights;
        }
-       
-       /**
-        * @param $roles Array: list of roles
-        * @return array list of groups with the given permission
-        */
-       static function getGroupsInRoles( $roles ) {
-               global $wgGroupPermissions;
-               $allowedGroups = array();
-               foreach ( $roles as $role ) {
-                       foreach ( $wgGroupPermissions as $group => $rights ) {
-                               if ( $rights[$role] === true ) {
-                                       $allowedGroups[$role][] = $group;
-                               }
-                       }
-               }
-               return $allowedGroups;
-       }
 
        /**
         * @param $group String: key name