Introduce DISALLOW_FILE_MOD for disabling all ops that modify core, theme, or plugins files. see #13000
git-svn-id: https://develop.svn.wordpress.org/trunk@14088 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
b9bdd0bfb1
commit
8e25b7d538
@ -993,7 +993,6 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
break;
|
||||
}
|
||||
// Fall through if not DISALLOW_FILE_EDIT.
|
||||
case 'unfiltered_html':
|
||||
case 'update_plugins':
|
||||
case 'delete_plugins':
|
||||
case 'install_plugins':
|
||||
@ -1001,6 +1000,14 @@ function map_meta_cap( $cap, $user_id ) {
|
||||
case 'delete_themes':
|
||||
case 'install_themes':
|
||||
case 'update_core':
|
||||
// Disallow anything that creates, deletes, or edits core, plugin, or theme files.
|
||||
// Files in uploads are excepted.
|
||||
if ( defined('DISALLOW_FILE_MODS') && DISALLOW_FILE_MODS ) {
|
||||
$caps[] = 'do_not_allow';
|
||||
break;
|
||||
}
|
||||
// Fall through if not DISALLOW_FILE_MODS.
|
||||
case 'unfiltered_html':
|
||||
case 'delete_user':
|
||||
case 'delete_users':
|
||||
// If multisite these caps are allowed only for super admins.
|
||||
|
Loading…
Reference in New Issue
Block a user