Aude has uploaded a new change for review.
https://gerrit.wikimedia.org/r/199290
Change subject: Check User::isBlockedFrom via slave database
......................................................................
Check User::isBlockedFrom via slave database
Even better would be to not need these variables (see T93773).
But checking from slave is at least better than master
for this.
Also updated the todos and code documentation regarding
these variables. Stuff like "//TODO: Deprecated"
dates back to August 2012 in Ie034d9. After digging
through the history of this, I don't quite get why
this is marked as deprecated, but nonetheless the
entire thing should be removed asap.
Change-Id: I7de6da50651eb815a57774400a97354896154d5d
---
M repo/includes/OutputPageJsConfigBuilder.php
1 file changed, 6 insertions(+), 4 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Wikibase
refs/changes/90/199290/1
diff --git a/repo/includes/OutputPageJsConfigBuilder.php
b/repo/includes/OutputPageJsConfigBuilder.php
index e3486ab..94732aa 100644
--- a/repo/includes/OutputPageJsConfigBuilder.php
+++ b/repo/includes/OutputPageJsConfigBuilder.php
@@ -62,12 +62,14 @@
private function getUserConfigVars( Title $title, User $user ) {
$configVars = array();
- // TODO: replace wbUserIsBlocked this with more useful info
(which groups would be
- // required to edit? compare wgRestrictionEdit and
wgRestrictionCreate)
- $configVars['wbUserIsBlocked'] = $user->isBlockedFrom( $title
); //NOTE: deprecated
+ // This is used in wikibase.ui.entityViewInit.js to double
check if a user
+ // can edit, and if so, initializes relevant javascript.
+ //
+ // @todo: remove these variables if the javascript no longer
really
+ // needs them. This check involves database lookup, which is
not nice.
+ $configVars['wbUserIsBlocked'] = $user->isBlockedFrom( $title,
true );
// tell JS whether the user can edit
- // TODO: make this a per-entity info
$configVars['wbUserCanEdit'] = $title->userCan( 'edit', $user,
false );
return $configVars;
--
To view, visit https://gerrit.wikimedia.org/r/199290
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I7de6da50651eb815a57774400a97354896154d5d
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Aude <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits