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).
}
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