r38533 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r38532‎ | r38533 | r38534 >
Date:05:14, 4 August 2008
Author:demon
Status:old
Tags:
Comment:
Reimplement User::, now with less crappy name and only taking one permission at a time. :)
Modified paths:
  • /trunk/phase3/includes/User.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/User.php
@@ -2767,6 +2767,23 @@
27682768 }
27692769 return $rights;
27702770 }
 2771+
 2772+ /**
 2773+ * Get all the groups who have a given permission
 2774+ *
 2775+ * @param $role String: Role to check
 2776+ * @return array list of groups with the given permission
 2777+ */
 2778+ static function getGroupsWithPermission( $role ) {
 2779+ global $wgGroupPermissions;
 2780+ $allowedGroups = array();
 2781+ foreach ( $wgGroupPermissions as $group => $rights ) {
 2782+ if ( $rights[$role] === true ) {
 2783+ $allowedGroups[] = $group;
 2784+ }
 2785+ }
 2786+ return $allowedGroups;
 2787+ }
27712788
27722789 /**
27732790 * @param $group String: key name

Follow-up revisions

RevisionCommit summaryAuthorDate
r38612Update for r38533 -- avoid notice spew from groups that have no record for th...brion05:12, 5 August 2008

Status & tagging log