<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul, pre { overflow: auto; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<title>[16990] trunk/wp-admin: Remove check_permissions()
calls outside of AJAX context.</title>
</head>
<body>
<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.wordpress.org/changeset/16990">16990</a></dd>
<dt>Author</dt> <dd>nacin</dd>
<dt>Date</dt> <dd>2010-12-16 08:43:22 +0000 (Thu, 16 Dec 2010)</dd>
</dl>
<h3>Log Message</h3>
<pre>Remove check_permissions() calls outside of AJAX context. Also only check for switch_themes in check_permissions() for the themes table. see <a href="http://trac.wordpress.org/ticket/15326">#15326</a>.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkwpadmineditcommentsphp">trunk/wp-admin/edit-comments.php</a></li>
<li><a href="#trunkwpadminedittagsphp">trunk/wp-admin/edit-tags.php</a></li>
<li><a href="#trunkwpadmineditphp">trunk/wp-admin/edit.php</a></li>
<li><a href="#trunkwpadminincludesclasswpmsthemeslisttablephp">trunk/wp-admin/includes/class-wp-ms-themes-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswppluginslisttablephp">trunk/wp-admin/includes/class-wp-plugins-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpthemeslisttablephp">trunk/wp-admin/includes/class-wp-themes-list-table.php</a></li>
<li><a href="#trunkwpadminincludesclasswpuserslisttablephp">trunk/wp-admin/includes/class-wp-users-list-table.php</a></li>
<li><a href="#trunkwpadminlinkmanagerphp">trunk/wp-admin/link-manager.php</a></li>
<li><a href="#trunkwpadminnetworksitethemesphp">trunk/wp-admin/network/site-themes.php</a></li>
<li><a href="#trunkwpadminnetworksiteusersphp">trunk/wp-admin/network/site-users.php</a></li>
<li><a href="#trunkwpadminnetworksitesphp">trunk/wp-admin/network/sites.php</a></li>
<li><a href="#trunkwpadminnetworkthemesphp">trunk/wp-admin/network/themes.php</a></li>
<li><a href="#trunkwpadminnetworkusersphp">trunk/wp-admin/network/users.php</a></li>
<li><a href="#trunkwpadminplugininstallphp">trunk/wp-admin/plugin-install.php</a></li>
<li><a href="#trunkwpadminpluginsphp">trunk/wp-admin/plugins.php</a></li>
<li><a href="#trunkwpadminthemeinstallphp">trunk/wp-admin/theme-install.php</a></li>
<li><a href="#trunkwpadminthemesphp">trunk/wp-admin/themes.php</a></li>
<li><a href="#trunkwpadminuploadphp">trunk/wp-admin/upload.php</a></li>
<li><a href="#trunkwpadminusersphp">trunk/wp-admin/users.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkwpadmineditcommentsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-comments.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-comments.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/edit-comments.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -12,7 +12,6 @@
</span><span class="cx">         wp_die(__('Cheatin&#8217; uh?'));
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Comments_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx"> $pagenum = $wp_list_table->get_pagenum();
</span><span class="cx">
</span><span class="cx"> $doaction = $wp_list_table->current_action();
</span></span></pre></div>
<a id="trunkwpadminedittagsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit-tags.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit-tags.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/edit-tags.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -13,7 +13,6 @@
</span><span class="cx">         wp_die( __( 'Cheatin&#8217; uh?' ) );
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Terms_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> $title = $tax->labels->name;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadmineditphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/edit.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/edit.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/edit.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -24,7 +24,6 @@
</span><span class="cx">         wp_die(__('Cheatin&#8217; uh?'));
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Posts_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx"> $pagenum = $wp_list_table->get_pagenum();
</span><span class="cx">
</span><span class="cx"> // Back-compat for viewing comments of an entry
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpmsthemeslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-ms-themes-list-table.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-ms-themes-list-table.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/includes/class-wp-ms-themes-list-table.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -39,14 +39,12 @@
</span><span class="cx">         function check_permissions() {
</span><span class="cx">                 $menu_perms = get_site_option( 'menu_items', array() );
</span><span class="cx">
</span><del>-                if ( empty( $menu_perms['themes'] ) ) {
-                        if ( !is_super_admin() )
-                                wp_die( __( 'Cheatin&#8217; uh?' ) );
-                }
</del><ins>+                if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
+                        wp_die( __( 'Cheatin&#8217; uh?' ) );
</ins><span class="cx">
</span><span class="cx">                 if ( $this->is_site_themes && !current_user_can('manage_sites') )
</span><span class="cx">                         wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) );
</span><del>-                else if ( !$this->is_site_themes && !current_user_can('manage_network_themes') )
</del><ins>+                elseif ( !$this->is_site_themes && !current_user_can('manage_network_themes') )
</ins><span class="cx">                         wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswppluginslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-plugins-list-table.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-plugins-list-table.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/includes/class-wp-plugins-list-table.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -31,10 +31,8 @@
</span><span class="cx">                 if ( is_multisite() ) {
</span><span class="cx">                         $menu_perms = get_site_option( 'menu_items', array() );
</span><span class="cx">
</span><del>-                        if ( empty( $menu_perms['plugins'] ) ) {
-                                if ( !is_super_admin() )
-                                        wp_die( __( 'Cheatin&#8217; uh?' ) );
-                        }
</del><ins>+                        if ( empty( $menu_perms['plugins'] ) && ! is_super_admin() )
+                                wp_die( __( 'Cheatin&#8217; uh?' ) );
</ins><span class="cx">                 }
</span><span class="cx">
</span><span class="cx">                 if ( !current_user_can('activate_plugins') )
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpthemeslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-themes-list-table.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-themes-list-table.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/includes/class-wp-themes-list-table.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -12,7 +12,8 @@
</span><span class="cx">         var $features = array();
</span><span class="cx">
</span><span class="cx">         function check_permissions() {
</span><del>-                if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
</del><ins>+                // Do not check edit_theme_options here. AJAX calls for available themes require switch_themes.
+                if ( !current_user_can('switch_themes') )
</ins><span class="cx">                         wp_die( __( 'Cheatin&#8217; uh?' ) );
</span><span class="cx">         }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminincludesclasswpuserslisttablephp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/includes/class-wp-users-list-table.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/includes/class-wp-users-list-table.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/includes/class-wp-users-list-table.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -25,11 +25,11 @@
</span><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function check_permissions() {
</span><del>-                if ( !current_user_can('list_users') )
-                        wp_die(__('Cheatin&#8217; uh?'));
</del><ins>+                if ( ! $this->is_site_users && ! current_user_can( 'list_users' ) )
+                        wp_die( __( 'Cheatin&#8217; uh?' ) );
</ins><span class="cx">
</span><del>-                if ( $this->is_site_users && !current_user_can('manage_sites') )
-                        wp_die(__('You do not have sufficient permissions to edit this site.'));
</del><ins>+                if ( $this->is_site_users && ! current_user_can( 'manage_sites' ) )
+                        wp_die(__( 'You do not have sufficient permissions to edit this site.' ) );
</ins><span class="cx">         }
</span><span class="cx">
</span><span class="cx">         function prepare_items() {
</span></span></pre></div>
<a id="trunkwpadminlinkmanagerphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/link-manager.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/link-manager.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/link-manager.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -12,7 +12,6 @@
</span><span class="cx">         wp_die( __( 'You do not have sufficient permissions to edit the links for this site.' ) );
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Links_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> // Handle bulk deletes
</span><span class="cx"> $doaction = $wp_list_table->current_action();
</span></span></pre></div>
<a id="trunkwpadminnetworksitethemesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/site-themes.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/site-themes.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/network/site-themes.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -15,12 +15,10 @@
</span><span class="cx">
</span><span class="cx"> $menu_perms = get_site_option( 'menu_items', array() );
</span><span class="cx">
</span><del>-if ( empty( $menu_perms['themes'] ) ) {
-        if ( !is_super_admin() )
-                wp_die( __( 'Cheatin&#8217; uh?' ) );
-}
</del><ins>+if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
+        wp_die( __( 'Cheatin&#8217; uh?' ) );
</ins><span class="cx">
</span><del>-if ( !current_user_can('manage_sites') )
</del><ins>+if ( ! current_user_can( 'manage_sites' ) )
</ins><span class="cx">         wp_die( __( 'You do not have sufficient permissions to manage themes for this site.' ) );
</span><span class="cx">
</span><span class="cx"> add_contextual_help($current_screen,
</span><span class="lines">@@ -34,7 +32,6 @@
</span><span class="cx"> );
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_MS_Themes_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> $action = $wp_list_table->current_action();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminnetworksiteusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/site-users.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/site-users.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/network/site-users.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -17,7 +17,6 @@
</span><span class="cx">         wp_die(__('You do not have sufficient permissions to edit this site.'));
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Users_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx"> $wp_list_table->prepare_items();
</span><span class="cx">
</span><span class="cx"> $action = $wp_list_table->current_action();
</span></span></pre></div>
<a id="trunkwpadminnetworksitesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/sites.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/sites.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/network/sites.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -13,8 +13,10 @@
</span><span class="cx"> if ( ! is_multisite() )
</span><span class="cx">         wp_die( __( 'Multisite support is not enabled.' ) );
</span><span class="cx">
</span><ins>+if ( ! current_user_can( 'manage_sites' ) )
+        wp_die( __( 'You do not have permission to access this page.' ) );
+
</ins><span class="cx"> $wp_list_table = get_list_table('WP_MS_Sites_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> $title = __( 'Sites' );
</span><span class="cx"> $parent_file = 'sites.php';
</span></span></pre></div>
<a id="trunkwpadminnetworkthemesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/themes.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/themes.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/network/themes.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -15,16 +15,13 @@
</span><span class="cx">
</span><span class="cx"> $menu_perms = get_site_option( 'menu_items', array() );
</span><span class="cx">
</span><del>-if ( empty( $menu_perms['themes'] ) ) {
-        if ( !is_super_admin() )
-                wp_die( __( 'Cheatin&#8217; uh?' ) );
-}
</del><ins>+if ( empty( $menu_perms['themes'] ) && ! is_super_admin() )
+        wp_die( __( 'Cheatin&#8217; uh?' ) );
</ins><span class="cx">
</span><span class="cx"> if ( !current_user_can('manage_network_themes') )
</span><span class="cx">         wp_die( __( 'You do not have sufficient permissions to manage network themes.' ) );
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_MS_Themes_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> $action = $wp_list_table->current_action();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminnetworkusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/network/users.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/network/users.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/network/users.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -13,8 +13,10 @@
</span><span class="cx"> if ( ! is_multisite() )
</span><span class="cx">         wp_die( __( 'Multisite support is not enabled.' ) );
</span><span class="cx">
</span><ins>+if ( ! current_user_can( 'manage_network_users' ) )
+        wp_die( __( 'You do not have permission to access this page.' ) );
+
</ins><span class="cx"> $wp_list_table = get_list_table('WP_MS_Users_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx"> $wp_list_table->prepare_items();
</span><span class="cx">
</span><span class="cx"> $title = __( 'Users' );
</span></span></pre></div>
<a id="trunkwpadminplugininstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugin-install.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugin-install.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/plugin-install.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -11,6 +11,7 @@
</span><span class="cx">
</span><span class="cx"> /** WordPress Administration Bootstrap */
</span><span class="cx"> require_once('./admin.php');
</span><ins>+
</ins><span class="cx"> if ( ! current_user_can('install_plugins') )
</span><span class="cx">         wp_die(__('You do not have sufficient permissions to install plugins on this site.'));
</span><span class="cx">
</span><span class="lines">@@ -20,7 +21,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Plugin_Install_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx"> $wp_list_table->prepare_items();
</span><span class="cx">
</span><span class="cx"> $title = __('Install Plugins');
</span></span></pre></div>
<a id="trunkwpadminpluginsphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/plugins.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/plugins.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/plugins.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -9,11 +9,17 @@
</span><span class="cx"> /** WordPress Administration Bootstrap */
</span><span class="cx"> require_once('./admin.php');
</span><span class="cx">
</span><ins>+if ( is_multisite() ) {
+        $menu_perms = get_site_option( 'menu_items', array() );
+
+        if ( empty( $menu_perms['plugins'] ) && ! is_super_admin() )
+                wp_die( __( 'Cheatin&#8217; uh?' ) );
+}
+
</ins><span class="cx"> if ( !current_user_can('activate_plugins') )
</span><span class="cx">         wp_die( __( 'You do not have sufficient permissions to manage plugins for this site.' ) );
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Plugins_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> $action = $wp_list_table->current_action();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkwpadminthemeinstallphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/theme-install.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/theme-install.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/theme-install.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -11,6 +11,7 @@
</span><span class="cx">
</span><span class="cx"> /** WordPress Administration Bootstrap */
</span><span class="cx"> require_once('./admin.php');
</span><ins>+
</ins><span class="cx"> if ( ! current_user_can('install_themes') )
</span><span class="cx">         wp_die( __( 'You do not have sufficient permissions to install themes on this site.' ) );
</span><span class="cx">
</span><span class="lines">@@ -20,7 +21,6 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Theme_Install_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx"> $wp_list_table->prepare_items();
</span><span class="cx">
</span><span class="cx"> $title = __('Install Themes');
</span></span></pre></div>
<a id="trunkwpadminthemesphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/themes.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/themes.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/themes.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -8,11 +8,11 @@
</span><span class="cx">
</span><span class="cx"> /** WordPress Administration Bootstrap */
</span><span class="cx"> require_once('./admin.php');
</span><ins>+
</ins><span class="cx"> if ( !current_user_can('switch_themes') && !current_user_can('edit_theme_options') )
</span><span class="cx">         wp_die( __( 'Cheatin&#8217; uh?' ) );
</span><span class="cx">
</span><span class="cx"> $wp_list_table = get_list_table('WP_Themes_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> if ( current_user_can( 'switch_themes' ) && isset($_GET['action'] ) ) {
</span><span class="cx">         if ( 'activate' == $_GET['action'] ) {
</span></span></pre></div>
<a id="trunkwpadminuploadphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/upload.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/upload.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/upload.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -9,8 +9,10 @@
</span><span class="cx"> /** WordPress Administration Bootstrap */
</span><span class="cx"> require_once( './admin.php' );
</span><span class="cx">
</span><ins>+if ( !current_user_can('upload_files') )
+        wp_die( __( 'You do not have permission to upload files.' ) );
+
</ins><span class="cx"> $wp_list_table = get_list_table('WP_Media_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> // Handle bulk actions
</span><span class="cx"> $doaction = $wp_list_table->current_action();
</span></span></pre></div>
<a id="trunkwpadminusersphp"></a>
<div class="modfile"><h4>Modified: trunk/wp-admin/users.php (16989 => 16990)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/wp-admin/users.php        2010-12-16 08:09:21 UTC (rev 16989)
+++ trunk/wp-admin/users.php        2010-12-16 08:43:22 UTC (rev 16990)
</span><span class="lines">@@ -9,8 +9,10 @@
</span><span class="cx"> /** WordPress Administration Bootstrap */
</span><span class="cx"> require_once( './admin.php' );
</span><span class="cx">
</span><ins>+if ( ! current_user_can( 'list_users' ) )
+        wp_die( __( 'Cheatin&#8217; uh?' ) );
+
</ins><span class="cx"> $wp_list_table = get_list_table('WP_Users_List_Table');
</span><del>-$wp_list_table->check_permissions();
</del><span class="cx">
</span><span class="cx"> $title = __('Users');
</span><span class="cx"> $parent_file = 'users.php';
</span></span></pre>
</div>
</div>
</body>
</html>