Remove certain caps for non super admins when running multisite. see #11644

git-svn-id: https://develop.svn.wordpress.org/trunk@12630 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Ryan Boren 2010-01-07 04:05:53 +00:00
parent e1a37a3563
commit 435053b040
1 changed files with 15 additions and 1 deletions

View File

@ -949,11 +949,25 @@ function map_meta_cap( $cap, $user_id ) {
$caps[] = 'read_private_pages';
break;
case 'unfiltered_upload':
if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS == true )
if ( defined('ALLOW_UNFILTERED_UPLOADS') && ALLOW_UNFILTERED_UPLOADS == true && ( !is_multisite() || is_super_admin() ) )
$caps[] = $cap;
else
$caps[] = 'do_not_allow';
break;
case 'unfiltered_html':
case 'update_plugins':
case 'delete_plugins':
case 'install_plugins':
case 'edit_plugins':
case 'update_themes':
case 'install_themes':
case 'edit_themes':
// If multisite these caps are allowed only for super admins.
if ( is_multisite() && !is_super_admin() )
$caps[] = 'do_not_allow';
else
$caps[] = $cap;
break;
default:
// If no meta caps match, return the original cap.
$caps[] = $cap;