Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F4992
ApiPermissions.patch
Public
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
•
bzimport
Nov 21 2014, 10:14 PM
2014-11-21 22:14:52 (UTC+0)
Size
1 KB
Referenced Files
None
Subscribers
None
ApiPermissions.patch
View Options
Index: includes/api/ApiMain.php
===================================================================
--- includes/api/ApiMain.php (revision 38540)
+++ includes/api/ApiMain.php (working copy)
@@ -99,7 +99,20 @@
'dbg' => 'ApiFormatDbg',
'dbgfm' => 'ApiFormatDbg'
);
+
+ /**
+ * List of user roles that are specifically relevant to the API.
+ * array( 'right' => array ( 'msg' => 'Some message with a $1',
+ * 'params' => array ( $someVarToSubst ) ),
+ * );
+ */
+ private static $Rights = array( 'writeapi' => array( 'msg' => 'Use of the write API' ,
+ 'params' => array() ),
+ 'apihighlimits' => array( 'msg' => 'Use higher limits in API queries (Slow queries: $1 results; Fast queries: $2 results)',
+ 'params' => array ( ApiMain :: LIMIT_SML2, ApiMain :: LIMIT_BIG2 ) ),
+ );
+
private $mPrinter, $mModules, $mModuleNames, $mFormats, $mFormatNames;
private $mResult, $mAction, $mShowVersions, $mEnableWrite, $mRequest, $mInternalMode, $mSquidMaxage;
@@ -525,6 +538,14 @@
$msg .= "\n";
}
+ $msg .= "\n$astriks Permissions $astriks\n\n";
+ foreach ( self :: $Rights as $right => $rightMsg ) {
+ $groups = User::getGroupsWithPermission( $right );
+ $msg .= "* " . $right . " *\n " . wfMsgReplaceArgs( $rightMsg[ 'msg' ], $rightMsg[ 'params' ] ) .
+ "\nGranted to:\n " . str_replace( "*", "all", implode( ", ", $groups ) ) . "\n";
+
+ }
+
$msg .= "\n$astriks Formats $astriks\n\n";
foreach( $this->mFormats as $formatName => $unused ) {
$module = $this->createPrinterByName($formatName);
File Metadata
Details
Attached
Mime Type
text/x-diff
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4555
Default Alt Text
ApiPermissions.patch (1 KB)
Attached To
Mode
T16713: Mention titles limit for action=query in API documentation
Attached
Detach File
Event Timeline
Log In to Comment