mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Capabilities: Prevent users having the do_not_allow
capability.
Meta capabilities use the capability `do_not_allow` to indicate a user should be blocked from performing a particular action. This ensures users can not have the capability as it would cause unexpected behaviour. Props johnbillion. Fixes #41059. Built from https://develop.svn.wordpress.org/trunk@40993 git-svn-id: http://core.svn.wordpress.org/trunk@40843 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
6fda2e67b0
commit
2b25a87d1b
@ -748,6 +748,9 @@ class WP_User {
|
||||
// Everyone is allowed to exist.
|
||||
$capabilities['exist'] = true;
|
||||
|
||||
// Nobody is allowed to do things they are not allowed to do.
|
||||
unset( $capabilities['do_not_allow'] );
|
||||
|
||||
// Must have ALL requested caps.
|
||||
foreach ( (array) $caps as $cap ) {
|
||||
if ( empty( $capabilities[ $cap ] ) )
|
||||
|
@ -4,7 +4,7 @@
|
||||
*
|
||||
* @global string $wp_version
|
||||
*/
|
||||
$wp_version = '4.9-alpha-40992';
|
||||
$wp_version = '4.9-alpha-40993';
|
||||
|
||||
/**
|
||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||
|
Loading…
Reference in New Issue
Block a user