Skip to content

Commit

Permalink
Ensure that editing capabilities on the client, match the server
Browse files Browse the repository at this point in the history
  • Loading branch information
bobbysmith007 committed Apr 2, 2018
1 parent 24cfbac commit 21d5ae6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion db-table-editor.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Plugin Name: DB-table-editor
Plugin URI: http://github.com/AcceleratioNet/wp-db-table-editor
Description: A plugin that adds "tools" pages to edit database tables
Version: 1.6.2
Version: 1.6.3
Author: Russ Tyndall @ Acceleration.net
Author URI: http://www.acceleration.net
Text Domain: wp-db-table-editor
Expand Down Expand Up @@ -247,6 +247,13 @@ function dbte_render($id=null){
// copy all DBTE slots to the json array
foreach($cur as $k => $v) { $args[$k] = $v; }
unset($args['sql']);
if(!isset($args['noedit']) || !$args['noedit']){
$editcap = @$args['editcap'];
if(!$editcap) $editcap = 'edit_others_posts';
if(!current_user_can($editcap)){
$args['noedit'] = true;
}
}
$json = json_encode($args);
$loadingLabel = __('Loading data...', 'wp-db-table-editor');
$exportButtonLabel = __('Export to CSV', 'wp-db-table-editor');
Expand Down

0 comments on commit 21d5ae6

Please sign in to comment.