mirror of
https://gerrit.wikimedia.org/r/mediawiki/skins/MinervaNeue
synced 2024-11-18 03:31:34 +00:00
0109b17483
In I1ccda3878a658d4251429ae65ebee04c09d81243, core decided to technically allow temp. users to have watchlist access, but have it disabled on permission level (viewmywatchlist / editmywatchlist) instead of by isNamed() checks. Minerva expects the watchlist permissions to be assigned to everyone, but actual watchlist access to be available only to named user. This is an incorrect assumption. Make a clear difference between "page is watchable" concept (watch icon should show) and "user has permission to watch" (if not, CTA to log in should show). There is one additional step to fix, which is ensure temp users receive the T330518 drawer. That is not a bug in MinervaNeue, but in core -- mediawiki.page.watch.ajax.js uses e.stopPropagating(), which means Minerva's CtaDrawer doesn't get a say. Ideally, mediawiki.page.watch.ajax.js would know whether the user has permissions to edit their watchlist. Alternatively, it could have an interface to allow extensions to add their own error handling. See T344925 for details. Bug: T344870 Change-Id: Id1757fb4fb433fe39cf4d5c6e1e9c65ab5abae14
56 lines
1.7 KiB
PHP
56 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* 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
|
|
*
|
|
* @file
|
|
*/
|
|
namespace MediaWiki\Minerva\Permissions;
|
|
|
|
/**
|
|
* A wrapper for all available Minerva permissions.
|
|
*/
|
|
interface IMinervaPagePermissions {
|
|
|
|
public const WATCHABLE = 'watchable';
|
|
public const WATCH = 'watch';
|
|
public const SWITCH_LANGUAGE = 'switch-language';
|
|
/** Given user permission, the page content is editable. */
|
|
public const CONTENT_EDIT = 'edit';
|
|
/** The existing page is editable or nonexisting page is creatable by the active user. */
|
|
public const EDIT_OR_CREATE = 'edit-or-create';
|
|
public const TALK = 'talk';
|
|
public const HISTORY = 'history';
|
|
public const MOVE = 'move';
|
|
public const DELETE = 'delete';
|
|
public const PROTECT = 'protect';
|
|
|
|
/**
|
|
* Gets whether or not the action is allowed.
|
|
*
|
|
* @param string $action
|
|
* @return bool
|
|
*/
|
|
public function isAllowed( $action );
|
|
|
|
/**
|
|
* Returns true, if the page can have a talk page and user is logged in.
|
|
*
|
|
* @return bool
|
|
*/
|
|
public function isTalkAllowed();
|
|
|
|
}
|