Last modified: 2007-09-09 08:13:55 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T9027, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 7027 - userCan hook for 'delete' needed
userCan hook for 'delete' needed
Status: RESOLVED FIXED
Product: MediaWiki
Classification: Unclassified
General/Unknown (Other open bugs)
unspecified
All All
: Normal enhancement with 1 vote (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2006-08-16 02:08 UTC by Barry
Modified: 2007-09-09 08:13 UTC (History)
2 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description Barry 2006-08-16 02:08:43 UTC
I would like custom handling of permissions for page deletions. There are
userCan hooks for 'read', 'edit', 'move', 'create' but not for 'delete'.

Currently various places check for $wgUser->isAllowed('delete') to decide
whether to display the 'delete'/'undelete' tabs or links, or to decide whether
to allow the deletion action.  Most of these checks could be replaced with calls
to $this->mTitle->userCanDelete().

The new userCanDelete function in Title.php would be:

	function userCanDelete() {
		return $this->userCan('delete');
	}

Easy?!
Comment 1 Jean-Lou Dupont 2007-05-04 17:01:24 UTC
I would suggest extending your proposal to cover other rights that could benefit
from a namespace level scope; e.g. patrol, protect, rollback, hiderevision,
deleterevision.

I am probably forgetting some of course.

[user:jldupont]
Comment 2 Andrew Garrett 2007-09-09 08:13:55 UTC
FIXED in r25680.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links