Page MenuHomePhabricator

Audit all userCan calls
Closed, ResolvedPublic

Description

Need to go through https://codesearch.wmflabs.org/search/?q=-%3EuserCan%5C(&i=nope&files=%5C.php%24&repos= and check each method to see the class whose method is called for T246139: Remove remaining Title::userCan calls and T246189: Follow up: Hard deprecate not passing a user to ::userCan methods

Title: Remove call in favor of permission manager
Revision: Remove call in favor of RevisionRecord::userCan with a user passed
ArchivedFile: Ensure a user is passed
OldLocalFile: Ensure a user is passed

Event Timeline

Restricted Application added a project: User-DannyS712. · View Herald TranscriptFeb 28 2020, 6:48 AM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
DannyS712 added a comment.EditedFeb 29 2020, 1:20 AM

Checking key:
T - Title
R - Revision
AF - ArchivedFile
OL - OldLocalFile
PM - PermissionManager

All repositories that need to be checked:

  • extensions / BlueSpiceFoundation: 13xT, 4xPM, 1x BlueSpice\IPermissionChecker::userCan
  • extensions / BlueSpiceContextMenu: 13xT
  • extensions / BlueSpiceSocial: 16x BlueSpice\Social\Entity::userCan, 3xT
  • extensions / BlueSpiceExtendedSearch: 9xT
  • extensions / BlueSpicePageAssignments: 6xT
  • extensions / BlueSpiceRating: 9x BlueSpice\Rating\RatingItem::userCan, 1xT
  • extensions / Echo: All refer to to EchoEvent::userCan
  • extensions / BlueSpiceSocialTopics: 3x BlueSpice\Social\Topics\Entity\Topic::userCan, 1x BlueSpice\Social\Topics\Entity\Discussion::userCan, 1xT
  • extensions / BlueSpiceSocialWikiPage: 4x BlueSpice\Social\WikiPage\Entity\Stash::userCan, 2x BlueSpice\Social\WikiPage\Entity\WikiPage::userCan
  • skins / BlueSpiceCalumma: 7xT
  • extensions / BlueSpiceReaders: 4xT
  • extensions / CollaborationKit: 11xPM
  • extensions / FlaggedRevs: 7xPM
  • extensions / MobileFrontend: 8xR
  • extensions / AdvancedMeta: 3xT
  • extensions / BlueSpiceArticleInfo: 3xT
  • extensions / BlueSpiceBookshelf: 4xT
  • extensions / BlueSpiceExpiry: 4xT
  • extensions / CommentStreams: 3xT
  • extensions / Flow: 1xPM, 2x Flow\Model\WorkFlow::userCan
  • extensions / PageForms: 3 permission checks, PermissionManager if MW >= 1.33, Title otherwise
  • extensions / Wikibase: 2xPM, 1xR
  • extensions / BlueSpiceBookshelfUI: 2xT
  • extensions / BlueSpiceExtendedStatistics: 2xT
  • extensions / BlueSpiceInsertCategory: 3xT
  • extensions / BlueSpiceNSFileRepoConnector: 2xT
  • extensions / BlueSpicePageTemplates: 4xT
  • extensions / BlueSpiceSaferEdit: 2xT
  • extensions / BlueSpiceSMWConnector: 2xT
  • extensions / BlueSpiceSocialProfile: 2x BlueSpice\Social\Profile\Entity\Profile::userCan
  • extensions / BlueSpiceSocialTags: 2x BlueSpice\Social\Entity::userCan, 2xT
  • extensions / BlueSpiceUEModulePDF: 2xT
  • extensions / BlueSpiceUniversalExport: 2xT
  • extensions / BlueSpiceWhoIsOnline: 2xT
  • extensions / CheckUser: 2xR
  • extensions / Commentbox: 2xT
  • extensions / MassMessage: 4xPM, 1xR
  • extensions / NSFileRepo: 2xT
  • extensions / PageSchemas: 1 permission check, PermissionManager if MW >= 1.33, Title otherwise
  • extensions / SpamDiffTool: 3xPM
  • extensions / TinyMCE: 2xT
  • extensions / Translate: 6xPM
  • extensions / Video: 1xPM, 1xT, 2xAF, 1xAF via ArchivedVideo, 3xR, 3x File or AF
  • extensions / WebDAV: 2xT
  • HydraWiki / SpriteSheet: 2xT
  • extensions / AbuseFilter: 3x ChangesList::userCan (static method, called non-statically)
  • extensions / ApprovedRevs: 1 permission check, PermissionManager if MW >= 1.34, Title otherwise
  • extensions / BlueSpiceAuthors: 1xT
  • extensions / BlueSpiceChecklist: 1xT
  • extensions / BlueSpiceDashboards: 1xT
  • extensions / BlueSpiceReminder: 1xT
  • extensions / BlueSpiceSocialBlog: 1x BlueSpice\Social\Blog\Entity\Blog::userCan
  • extensions / BlueSpiceSocialComments: 1x BlueSpice\Social\Comments\Entity\Comment::userCan
  • extensions / BlueSpiceSocialRating: 1x BlueSpice\Rating\RatingItem::userCan
  • extensions / BlueSpiceSocialResolve: 2x BlueSpice\Social\Entity::userCan
  • extensions / BlueSpiceTagCloud: 1xT
  • extensions / BlueSpiceUEModuleBookPDF: 1xT
  • extensions / BlueSpiceUEModulePDFRecursive: 2xT
  • extensions / BlueSpiceUEModulePDFSubpages: 1xT
  • extensions / BlueSpiceVisualEditorConnector: 1xT
  • extensions / BlueSpiceWatchList: 1xT
  • extensions / Cargo: 1 permission check, PermissionManager if MW >= 1.33, Title otherwise
  • extensions / ChangeAuthor: 1xR
  • extensions / Comments: 1x EchoEventPresentationModel::userCan
  • extensions / ContentTranslation: 1xPM
  • extensions / CreateAPage: Within a commented out block
  • extensions / DeleteUserPages: 1xT
  • extensions / EntitySchema: 1xPM
  • extensions / ExternalData: 1 permission check, PermissionManager if MW >= 1.33, Title otherwise
  • extensions / ForcePreview: 1xT
  • extensions / GettingStarted: 1xPM
  • extensions / GlobalContribs: 2xR
  • extensions / Jade: 2xPM
  • extensions / LiquidThreads: 2xPM
  • extensions / LogEntry: 1xT
  • extensions / MintyDocs: 1 permission check, PermissionManager if MW >= 1.33, Title otherwise
  • extensions / MultiLanguageManager: 1xT
  • extensions / PhpTagsStorage: 1xT
  • extensions / PluggableAuth: 1xT
  • extensions / PopcornEditor: 2xT
  • extensions / RevisionCommentSupplement: 1xR
  • extensions / RightFunctions: 1xT
  • extensions / S5SlideShow: 1xT
  • extensions / SimpleSecurity: 1xT
  • extensions / SlimboxThumbs: 2xT
  • extensions / SubPageList3: 1xPM
  • extensions / SVGEdit: 2xT
  • extensions / Thanks: 2x EchoEventPresentationModel::userCan
  • extensions / TranslateSvg 1xT
  • extensions / VisualEditor: 2xPM
  • hexmode / mediawiki-PageProtect 1xT
  • Nikerabbit / mediawiki-extensions-Termbank: 1xT
  • SemanticMediaWiki / SemanticMediaWiki: 2xT
  • skins / BlueSky: 1xT
  • skins / MinervaNeue: 2xPM

Change 576401 had a related patch set uploaded (by DannyS712; owner: DannyS712):
[mediawiki/extensions/BlueSpiceContextMenu@master] Remove use of Title::userCan

https://gerrit.wikimedia.org/r/576401

DannyS712 moved this task from Unsorted to In progress on the User-DannyS712 board.Mar 4 2020, 8:00 PM
DannyS712 closed this task as Resolved.Mar 8 2020, 1:32 AM

All checked, now just need to replace uses