MediaWiki
1.28.0
|
Functions and constants to deal with grants. More...
Static Public Member Functions | |
static | getGrantGroups ($grantsFilter=null) |
Divide the grants into groups. More... | |
static | getGrantRights ($grants) |
Fetch the rights allowed by a set of grants. More... | |
static | getGrantsLink ($grant, $lang=null) |
Generate a link to Special:ListGrants for a particular grant name. More... | |
static | getGrantsWikiText ($grantsFilter, $lang=null) |
Generate wikitext to display a list of grants. More... | |
static | getHiddenGrants () |
Get the list of grants that are hidden and should always be granted. More... | |
static | getRightsByGrant () |
Map all grants to corresponding user rights. More... | |
static | getValidGrants () |
List all known grants. More... | |
static | grantName ($grant, $lang=null) |
Fetch the display name of the grant. More... | |
static | grantNames (array $grants, $lang=null) |
Fetch the display names for the grants. More... | |
static | grantsAreValid (array $grants) |
Test that all grants in the list are known. More... | |
Functions and constants to deal with grants.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. http://www.gnu.org/copyleft/gpl.html A collection of public static functions to deal with grants.
Definition at line 24 of file MWGrants.php.
|
static |
Divide the grants into groups.
string[]|null | $grantsFilter |
Definition at line 132 of file MWGrants.php.
Referenced by MWGrantsTest\testGetGrantGroups().
|
static |
Fetch the rights allowed by a set of grants.
string[]|string | $grants |
Definition at line 106 of file MWGrants.php.
References array(), as, and global.
Referenced by MediaWiki\Session\Session\BotPasswordSessionProvider\newSessionForRequest(), MediaWiki\Session\Session\BotPasswordSessionProvider\refreshSessionInfo(), and MWGrantsTest\testGetGrantRights().
|
static |
Generate a link to Special:ListGrants for a particular grant name.
This should be used to link end users to a full description of what rights they are giving when they authorize a grant.
string | $grant | the grant name |
Language | string | null | $lang |
Definition at line 180 of file MWGrants.php.
References $lang, and SpecialPage\getTitleFor().
|
static |
Generate wikitext to display a list of grants.
string[]|null | $grantsFilter If non-null, only display these grants. | |
Language | string | null | $lang |
Definition at line 193 of file MWGrants.php.
References $lang, $s, $wgContLang, as, Language\factory(), global, and wfMessage().
|
static |
Get the list of grants that are hidden and should always be granted.
Definition at line 158 of file MWGrants.php.
Referenced by SpecialBotPasswords\getFormFields(), SpecialBotPasswords\save(), and MWGrantsTest\testGetHiddenGrants().
|
static |
Map all grants to corresponding user rights.
Definition at line 40 of file MWGrants.php.
References $res, as, and global.
Referenced by SpecialBotPasswords\getFormFields(), and MWGrantsTest\testGetRightsByGrant().
|
static |
List all known grants.
Definition at line 30 of file MWGrants.php.
References global.
Referenced by SpecialBotPasswords\getFormFields(), and MWGrantsTest\testGetValidGrants().
|
static |
Fetch the display name of the grant.
string | $grant | |
Language | string | null | $lang |
Definition at line 56 of file MWGrants.php.
References $lang, Language\factory(), and wfMessage().
|
static |
Fetch the display names for the grants.
string[] | $grants | |
Language | string | null | $lang |
Definition at line 87 of file MWGrants.php.
References $lang, $ret, as, and Language\factory().
|
static |
Test that all grants in the list are known.
string[] | $grants |
Definition at line 123 of file MWGrants.php.
Referenced by MWGrantsTest\testGrantsAreValid().