Version Description
- 17 Mar 2020 =
- Fixed : Capabilities screen was not accessible to non-Administrators who have "manage_capabilities" capability
- Fixed : Some functions were not accessible to network Super Administrators without a role on the site
- Change : Clarify some messages for plugin access denial
Download this release
Release Info
Developer | kevinB |
Plugin | Capability Manager Enhanced |
Version | 1.9.3 |
Comparing to | |
See all releases |
Code changes from version 1.9.2 to 1.9.3
- capsman-enhanced.php +5 -5
- includes/admin.php +1208 -1208
- includes/backup-handler.php +1 -1
- includes/cap-helper.php +2 -2
- includes/functions-admin.php +24 -22
- includes/manager.php +20 -18
- lang/capsman.mo +0 -0
- lang/capsman.po +3 -4
- readme.txt +365 -331
capsman-enhanced.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: PublishPress Capabilities
|
4 |
* Plugin URI: https://publishpress.com/capability-manager/
|
5 |
* Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
|
6 |
-
* Version: 1.9.
|
7 |
* Author: PublishPress
|
8 |
* Author URI: https://publishpress.com/
|
9 |
* Text Domain: capsman-enhanced
|
@@ -25,13 +25,13 @@
|
|
25 |
* @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2020 PublishPress
|
26 |
* @license GNU General Public License version 3
|
27 |
* @link https://publishpress.com/
|
28 |
-
* @version 1.9.
|
29 |
*/
|
30 |
|
31 |
if (!defined('CAPSMAN_VERSION')) {
|
32 |
-
define('CAPSMAN_VERSION', '1.9.
|
33 |
-
define('CAPSMAN_ENH_VERSION', '1.9.
|
34 |
-
define('PUBLISHPRESS_CAPS_VERSION', '1.9.
|
35 |
}
|
36 |
|
37 |
foreach (get_option('active_plugins') as $plugin_file) {
|
3 |
* Plugin Name: PublishPress Capabilities
|
4 |
* Plugin URI: https://publishpress.com/capability-manager/
|
5 |
* Description: Manage WordPress role definitions, per-site or network-wide. Organizes post capabilities by post type and operation.
|
6 |
+
* Version: 1.9.3
|
7 |
* Author: PublishPress
|
8 |
* Author URI: https://publishpress.com/
|
9 |
* Text Domain: capsman-enhanced
|
25 |
* @copyright Copyright (C) 2009, 2010 Jordi Canals; modifications Copyright (C) 2020 PublishPress
|
26 |
* @license GNU General Public License version 3
|
27 |
* @link https://publishpress.com/
|
28 |
+
* @version 1.9.3
|
29 |
*/
|
30 |
|
31 |
if (!defined('CAPSMAN_VERSION')) {
|
32 |
+
define('CAPSMAN_VERSION', '1.9.3');
|
33 |
+
define('CAPSMAN_ENH_VERSION', '1.9.3');
|
34 |
+
define('PUBLISHPRESS_CAPS_VERSION', '1.9.3');
|
35 |
}
|
36 |
|
37 |
foreach (get_option('active_plugins') as $plugin_file) {
|
includes/admin.php
CHANGED
@@ -1,1208 +1,1208 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* General Admin for Role Capabilities.
|
4 |
-
* Provides admin pages to create and manage roles and capabilities.
|
5 |
-
*
|
6 |
-
* @author Jordi Canals, Kevin Behrens
|
7 |
-
* @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2020 PublishPress
|
8 |
-
* @license GNU General Public License version 2
|
9 |
-
* @link https://publishpress.com
|
10 |
-
*
|
11 |
-
*
|
12 |
-
* Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
|
13 |
-
* Modifications Copyright 2020, PublishPress <help@publishpress.com>
|
14 |
-
*
|
15 |
-
* This program is free software; you can redistribute it and/or
|
16 |
-
* modify it under the terms of the GNU General Public License
|
17 |
-
* version 2 as published by the Free Software Foundation.
|
18 |
-
*
|
19 |
-
* This program is distributed in the hope that it will be useful,
|
20 |
-
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
-
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
-
* GNU General Public License for more details.
|
23 |
-
*
|
24 |
-
* You should have received a copy of the GNU General Public License
|
25 |
-
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
-
**/
|
27 |
-
|
28 |
-
global $capsman, $cme_cap_helper, $current_user;
|
29 |
-
|
30 |
-
do_action('publishpress-caps_manager-load');
|
31 |
-
|
32 |
-
$roles = $this->roles;
|
33 |
-
$default = $this->current;
|
34 |
-
|
35 |
-
if ( $block_read_removal = _cme_is_read_removal_blocked( $this->current ) ) {
|
36 |
-
if ( $current = get_role($default) ) {
|
37 |
-
if ( empty( $current->capabilities['read'] ) ) {
|
38 |
-
ak_admin_error( sprintf( __( 'Warning: This role cannot access the dashboard without the read capability. %1$sClick here to fix this now%2$s.', 'capsman-enhanced' ), '<a href="javascript:void(0)" class="cme-fix-read-cap">', '</a>' ) );
|
39 |
-
}
|
40 |
-
}
|
41 |
-
}
|
42 |
-
|
43 |
-
require_once( dirname(__FILE__).'/pp-ui.php' );
|
44 |
-
$pp_ui = new Capsman_PP_UI();
|
45 |
-
|
46 |
-
if( defined('PRESSPERMIT_ACTIVE') ) {
|
47 |
-
$pp_metagroup_caps = $pp_ui->get_metagroup_caps( $default );
|
48 |
-
} else {
|
49 |
-
$pp_metagroup_caps = array();
|
50 |
-
}
|
51 |
-
?>
|
52 |
-
<div class="wrap publishpress-caps-manage pressshack-admin-wrapper">
|
53 |
-
<?php if( defined('PRESSPERMIT_ACTIVE') ) :
|
54 |
-
pp_icon();
|
55 |
-
$style = 'style="height:60px;"';
|
56 |
-
?>
|
57 |
-
<?php else:
|
58 |
-
$style = '';
|
59 |
-
?>
|
60 |
-
<div id="icon-capsman-admin" class="icon32"></div>
|
61 |
-
<?php endif; ?>
|
62 |
-
|
63 |
-
<h1 <?php echo $style;?>><?php _e('Role Capabilities', 'capsman-enhanced') ?></h1>
|
64 |
-
|
65 |
-
<form id="publishpress_caps_form" method="post" action="admin.php?page=<?php echo $this->ID ?>">
|
66 |
-
<?php wp_nonce_field('capsman-general-manager'); ?>
|
67 |
-
<fieldset>
|
68 |
-
<table id="akmin">
|
69 |
-
<tr>
|
70 |
-
<td class="content">
|
71 |
-
<dl>
|
72 |
-
<dt>
|
73 |
-
<?php
|
74 |
-
$role_caption = (defined('PUBLISHPRESS_VERSION'))
|
75 |
-
? '<a href="' . admin_url("admin.php?page=pp-manage-roles&action=edit-role&role-id={$this->current}") . '">' . translate_user_role($roles[$default]) . '</a>'
|
76 |
-
: translate_user_role($roles[$default]);
|
77 |
-
|
78 |
-
printf(__('Capabilities for %s', 'capsman-enhanced'), $role_caption);
|
79 |
-
?>
|
80 |
-
</dt>
|
81 |
-
|
82 |
-
<dd>
|
83 |
-
<div style="float:right">
|
84 |
-
<input type="submit" name="SaveRole" value="<?php _e('Save Changes', 'capsman-enhanced') ?>" class="button-primary" />
|
85 |
-
</div>
|
86 |
-
|
87 |
-
<?php
|
88 |
-
global $capsman;
|
89 |
-
$img_url = $capsman->mod_url . '/images/';
|
90 |
-
?>
|
91 |
-
<div class="publishpress-headline">
|
92 |
-
<span class="cme-subtext">
|
93 |
-
<?php
|
94 |
-
$msg = __( '<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation.', 'capsman-enhanced' );
|
95 |
-
|
96 |
-
if (defined('PRESSPERMIT_ACTIVE') && function_exists('presspermit')) {
|
97 |
-
if ($group = presspermit()->groups()->getMetagroup('wp_role', $this->current)) {
|
98 |
-
$msg = sprintf(
|
99 |
-
__('<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation. You can also configure this role as a %sPermission Group%s.', 'capsman-enhanced'),
|
100 |
-
'<a href="' . admin_url("admin.php?page=presspermit-edit-permissions&action=edit&agent_id={$group->ID}") . '">',
|
101 |
-
'</a>'
|
102 |
-
);
|
103 |
-
}
|
104 |
-
}
|
105 |
-
echo $msg;
|
106 |
-
?>
|
107 |
-
</span>
|
108 |
-
</div>
|
109 |
-
|
110 |
-
<?php
|
111 |
-
if ( defined( 'PRESSPERMIT_ACTIVE' ) ) {
|
112 |
-
$pp_ui->show_capability_hints( $default );
|
113 |
-
}
|
114 |
-
?>
|
115 |
-
|
116 |
-
<script type="text/javascript">
|
117 |
-
/* <![CDATA[ */
|
118 |
-
jQuery(document).ready( function($) {
|
119 |
-
$('a[href="#pp-more"]').click( function() {
|
120 |
-
$('#pp_features').show();
|
121 |
-
return false;
|
122 |
-
});
|
123 |
-
$('a[href="#pp-hide"]').click( function() {
|
124 |
-
$('#pp_features').hide();
|
125 |
-
return false;
|
126 |
-
});
|
127 |
-
});
|
128 |
-
/* ]]> */
|
129 |
-
</script>
|
130 |
-
|
131 |
-
<?php /* play.png icon by Pavel: http://kde-look.org/usermanager/search.php?username=InFeRnODeMoN */ ?>
|
132 |
-
|
133 |
-
<br /><div id="pp_features" style="display:none"><div class="pp-logo"><a href="https://publishpress.com/presspermit/"><img src="<?php echo $img_url;?>pp-logo.png" alt="<?php _e('PublishPress Permissions', 'capsman-enhanced');?>" /></a></div><div class="features-wrap"><ul class="pp-features">
|
134 |
-
<li>
|
135 |
-
<?php _e( "Automatically define type-specific capabilities for your custom post types and taxonomies", 'capsman-enhanced' );?>
|
136 |
-
<a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
137 |
-
|
138 |
-
<li>
|
139 |
-
<?php _e( "Assign standard WP roles supplementally for a specific post type", 'capsman-enhanced' );?>
|
140 |
-
<a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
141 |
-
|
142 |
-
<li>
|
143 |
-
<?php _e( "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>", 'capsman-enhanced' );?>
|
144 |
-
</li>
|
145 |
-
|
146 |
-
<li>
|
147 |
-
<?php _e( "Customize reading permissions per-category or per-post", 'capsman-enhanced' );?>
|
148 |
-
<a href="https://presspermit.com/tutorial/category-exceptions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
149 |
-
|
150 |
-
<li>
|
151 |
-
<?php _e( "Customize editing permissions per-category or per-post <em>(Pro)</em>", 'capsman-enhanced' );?>
|
152 |
-
<a href="https://presspermit.com/tutorial/page-editing-exceptions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
153 |
-
|
154 |
-
<li>
|
155 |
-
<?php _e( "Custom Post Visibility statuses, fully implemented throughout wp-admin <em>(Pro)</em>", 'capsman-enhanced' );?>
|
156 |
-
<a href="https://presspermit.com/tutorial/custom-post-visibility" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
157 |
-
|
158 |
-
<li>
|
159 |
-
<?php _e( "Custom Moderation statuses for access-controlled, multi-step publishing workflow <em>(Pro)</em>", 'capsman-enhanced' );?>
|
160 |
-
<a href="https://presspermit.com/tutorial/multi-step-moderation" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
161 |
-
|
162 |
-
<li>
|
163 |
-
<?php _e( "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>", 'capsman-enhanced' );?>
|
164 |
-
<a href="https://presspermit.com/tutorial/edit-flow-integration" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
165 |
-
|
166 |
-
<li>
|
167 |
-
<?php _e( "Customize the moderated editing of published content with Revisionary or Post Forking <em>(Pro)</em>", 'capsman-enhanced' );?>
|
168 |
-
<a href="https://presspermit.com/tutorial/published-content-revision" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
169 |
-
|
170 |
-
<li>
|
171 |
-
<?php _e( "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>", 'capsman-enhanced' );?>
|
172 |
-
</li>
|
173 |
-
|
174 |
-
<li>
|
175 |
-
<?php _e( "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>", 'capsman-enhanced' );?>
|
176 |
-
<a href="https://presspermit.com/tutorial/buddypress-content-permissions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
177 |
-
|
178 |
-
<li>
|
179 |
-
<?php _e( "WPML integration to mirror permissions to translations <em>(Pro)</em>", 'capsman-enhanced' );?>
|
180 |
-
</li>
|
181 |
-
|
182 |
-
<li>
|
183 |
-
<?php _e( "Member support forum", 'capsman-enhanced' );?>
|
184 |
-
</li>
|
185 |
-
|
186 |
-
</ul></div>
|
187 |
-
|
188 |
-
<?php
|
189 |
-
echo '<div>';
|
190 |
-
printf( __('%1$sgrab%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<span class="plugins update-message"><a href="' . cme_plugin_info_url('press-permit-core') . '" class="thickbox" title="' . sprintf( __('%s (free install)', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions Pro</a></span>' );
|
191 |
-
echo ' • ';
|
192 |
-
printf( __('%1$sbuy%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<a href="https://publishpress.com/presspermit/" target="_blank" title="' . sprintf( __('%s info/purchase', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions Pro</a>' );
|
193 |
-
echo ' • ';
|
194 |
-
echo '<a href="#pp-hide">hide</a>';
|
195 |
-
echo '</div></div>';
|
196 |
-
|
197 |
-
if ( MULTISITE ) {
|
198 |
-
global $wp_roles;
|
199 |
-
global $wpdb;
|
200 |
-
|
201 |
-
if ( ! empty($_REQUEST['cme_net_sync_role'] ) ) {
|
202 |
-
switch_to_blog(1);
|
203 |
-
wp_cache_delete( $wpdb->prefix . 'user_roles', 'options' );
|
204 |
-
}
|
205 |
-
|
206 |
-
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
|
207 |
-
}
|
208 |
-
$capsman->reinstate_db_roles();
|
209 |
-
|
210 |
-
$current = get_role($default);
|
211 |
-
|
212 |
-
$rcaps = $current->capabilities;
|
213 |
-
|
214 |
-
$is_administrator = current_user_can( 'administrator' ) || (is_multisite() && is_super_admin());
|
215 |
-
|
216 |
-
$custom_types = get_post_types( array( '_builtin' => false ), 'names' );
|
217 |
-
$custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
|
218 |
-
|
219 |
-
$defined = array();
|
220 |
-
$defined['type'] = get_post_types( array( 'public' => true, 'show_ui' => true ), 'object', 'or' );
|
221 |
-
$defined['taxonomy'] = get_taxonomies( array( 'public' => true ), 'object' );
|
222 |
-
|
223 |
-
$unfiltered['type'] = apply_filters( 'pp_unfiltered_post_types', array( 'forum','topic','reply','wp_block' ) ); // bbPress' dynamic role def requires additional code to enforce stored caps
|
224 |
-
$unfiltered['taxonomy'] = apply_filters( 'pp_unfiltered_taxonomies', array( 'post_status', 'topic-tag' ) ); // avoid confusion with Edit Flow administrative taxonomy
|
225 |
-
|
226 |
-
$enabled_taxonomies = cme_get_assisted_taxonomies();
|
227 |
-
|
228 |
-
/*
|
229 |
-
if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
|
230 |
-
$cap_properties[''] = array();
|
231 |
-
$force_distinct_ui = true;
|
232 |
-
}
|
233 |
-
*/
|
234 |
-
|
235 |
-
$cap_properties['edit']['type'] = array( 'edit_posts' );
|
236 |
-
|
237 |
-
foreach( $defined['type'] as $type_obj ) {
|
238 |
-
if ( 'attachment' != $type_obj->name ) {
|
239 |
-
if ( isset( $type_obj->cap->create_posts ) && ( $type_obj->cap->create_posts != $type_obj->cap->edit_posts ) ) {
|
240 |
-
$cap_properties['edit']['type'][]= 'create_posts';
|
241 |
-
break;
|
242 |
-
}
|
243 |
-
}
|
244 |
-
}
|
245 |
-
|
246 |
-
$cap_properties['edit']['type'][]= 'edit_others_posts';
|
247 |
-
$cap_properties['edit']['type'] = array_merge( $cap_properties['edit']['type'], array( 'publish_posts', 'edit_published_posts', 'edit_private_posts' ) );
|
248 |
-
|
249 |
-
$cap_properties['edit']['taxonomy'] = array( 'manage_terms' );
|
250 |
-
|
251 |
-
if ( ! defined( 'OLD_PRESSPERMIT_ACTIVE' ) )
|
252 |
-
$cap_properties['edit']['taxonomy'] = array_merge( $cap_properties['edit']['taxonomy'], array( 'edit_terms', 'assign_terms' ) );
|
253 |
-
|
254 |
-
$cap_properties['delete']['type'] = array( 'delete_posts', 'delete_others_posts' );
|
255 |
-
$cap_properties['delete']['type'] = array_merge( $cap_properties['delete']['type'], array( 'delete_published_posts', 'delete_private_posts' ) );
|
256 |
-
|
257 |
-
if ( ! defined( 'OLD_PRESSPERMIT_ACTIVE' ) )
|
258 |
-
$cap_properties['delete']['taxonomy'] = array( 'delete_terms' );
|
259 |
-
else
|
260 |
-
$cap_properties['delete']['taxonomy'] = array();
|
261 |
-
|
262 |
-
$cap_properties['read']['type'] = array( 'read_private_posts' );
|
263 |
-
$cap_properties['read']['taxonomy'] = array();
|
264 |
-
|
265 |
-
$stati = get_post_stati( array( 'internal' => false ) );
|
266 |
-
|
267 |
-
$cap_type_names = array(
|
268 |
-
'' => __( ' ', 'capsman-enhanced' ),
|
269 |
-
'read' => __( 'Reading', 'capsman-enhanced' ),
|
270 |
-
'edit' => __( 'Editing Capabilities', 'capsman-enhanced' ),
|
271 |
-
'delete' => __( 'Deletion Capabilities', 'capsman-enhanced' )
|
272 |
-
);
|
273 |
-
|
274 |
-
$cap_tips = array(
|
275 |
-
'read_private' => __( 'can read posts which are currently published with private visibility', 'capsman-enhanced' ),
|
276 |
-
'edit' => __( 'has basic editing capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
|
277 |
-
'edit_others' => __( 'can edit posts which were created by other users', 'capsman-enhanced' ),
|
278 |
-
'edit_published' => __( 'can edit posts which are currently published', 'capsman-enhanced' ),
|
279 |
-
'edit_private' => __( 'can edit posts which are currently published with private visibility', 'capsman-enhanced' ),
|
280 |
-
'publish' => __( 'can make a post publicly visible', 'capsman-enhanced' ),
|
281 |
-
'delete' => __( 'has basic deletion capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
|
282 |
-
'delete_others' => __( 'can delete posts which were created by other users', 'capsman-enhanced' ),
|
283 |
-
'delete_published' => __( 'can delete posts which are currently published', 'capsman-enhanced' ),
|
284 |
-
'delete_private' => __( 'can delete posts which are currently published with private visibility', 'capsman-enhanced' ),
|
285 |
-
);
|
286 |
-
|
287 |
-
$default_caps = array( 'read_private_posts', 'edit_posts', 'edit_others_posts', 'edit_published_posts', 'edit_private_posts', 'publish_posts', 'delete_posts', 'delete_others_posts', 'delete_published_posts', 'delete_private_posts',
|
288 |
-
'read_private_pages', 'edit_pages', 'edit_others_pages', 'edit_published_pages', 'edit_private_pages', 'publish_pages', 'delete_pages', 'delete_others_pages', 'delete_published_pages', 'delete_private_pages',
|
289 |
-
'manage_categories'
|
290 |
-
);
|
291 |
-
$type_caps = array();
|
292 |
-
$type_metacaps = array();
|
293 |
-
|
294 |
-
// Role Scoper and PP1 adjust attachment access based only on user's capabilities for the parent post
|
295 |
-
if ( defined('OLD_PRESSPERMIT_ACTIVE') ) {
|
296 |
-
unset( $defined['type']['attachment'] );
|
297 |
-
}
|
298 |
-
|
299 |
-
echo '<ul class="cme-listhoriz">';
|
300 |
-
|
301 |
-
// cap_types: read, edit, deletion
|
302 |
-
foreach( array_keys($cap_properties) as $cap_type ) {
|
303 |
-
echo '<li>';
|
304 |
-
echo '<h3>' . $cap_type_names[$cap_type] . '</h3>';
|
305 |
-
|
306 |
-
echo "<div class='cme-cap-type-tables cme-cap-type-tables-$cap_type'>";
|
307 |
-
|
308 |
-
foreach( array_keys($defined) as $item_type ) {
|
309 |
-
if ( ( 'delete' == $cap_type ) && ( 'taxonomy' == $item_type ) ) {
|
310 |
-
if ( defined('OLD_PRESSPERMIT_ACTIVE') ) {
|
311 |
-
continue;
|
312 |
-
}
|
313 |
-
|
314 |
-
$any_term_deletion_caps = false;
|
315 |
-
foreach( array_keys($defined['taxonomy']) as $_tax ) {
|
316 |
-
if ( isset( $defined['taxonomy'][$_tax]->cap->delete_terms ) && ( 'manage_categories' != $defined['taxonomy'][$_tax]->cap->delete_terms ) && ! in_array( $_tax, $unfiltered['taxonomy'] ) ) {
|
317 |
-
$any_term_deletion_caps = true;
|
318 |
-
break;
|
319 |
-
}
|
320 |
-
}
|
321 |
-
|
322 |
-
if ( ! $any_term_deletion_caps )
|
323 |
-
continue;
|
324 |
-
}
|
325 |
-
|
326 |
-
if ( ! count( $cap_properties[$cap_type][$item_type] ) )
|
327 |
-
continue;
|
328 |
-
|
329 |
-
echo "<table class='cme-typecaps cme-typecaps-$cap_type'>";
|
330 |
-
|
331 |
-
echo '<tr><th></th>';
|
332 |
-
|
333 |
-
// label cap properties
|
334 |
-
foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
|
335 |
-
$prop = str_replace( '_posts', '', $prop );
|
336 |
-
$prop = str_replace( '_pages', '', $prop );
|
337 |
-
$prop = str_replace( '_terms', '', $prop );
|
338 |
-
$tip = ( isset( $cap_tips[$prop] ) ) ? "title='{$cap_tips[$prop]}'" : '';
|
339 |
-
$prop = str_replace( '_', '<br />', $prop );
|
340 |
-
$th_class = ( 'taxonomy' == $item_type ) ? ' class="term-cap"' : ' class="post-cap"';
|
341 |
-
echo "<th $tip{$th_class}>";
|
342 |
-
|
343 |
-
if ( ( 'delete' != $prop ) || ( 'taxonomy' != $item_type ) || cme_get_detailed_taxonomies() ) {
|
344 |
-
echo ucwords($prop);
|
345 |
-
}
|
346 |
-
|
347 |
-
echo '</th>';
|
348 |
-
}
|
349 |
-
|
350 |
-
echo '</tr>';
|
351 |
-
|
352 |
-
foreach( $defined[$item_type] as $key => $type_obj ) {
|
353 |
-
if ( in_array( $key, $unfiltered[$item_type] ) )
|
354 |
-
continue;
|
355 |
-
|
356 |
-
$row = "<tr class='cme_type_{$key}'>";
|
357 |
-
|
358 |
-
if ( $cap_type ) {
|
359 |
-
if ( empty($force_distinct_ui) && empty( $cap_properties[$cap_type][$item_type] ) )
|
360 |
-
continue;
|
361 |
-
|
362 |
-
$row .= "<td><a class='cap_type' href='#toggle_type_caps'>" . $type_obj->labels->name . '</a>';
|
363 |
-
$row .= '<a href="#" class="neg-type-caps"> x </a>';
|
364 |
-
$row .= '</td>';
|
365 |
-
|
366 |
-
$display_row = ! empty($force_distinct_ui);
|
367 |
-
|
368 |
-
foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
|
369 |
-
$td_classes = array();
|
370 |
-
$checkbox = '';
|
371 |
-
$title = '';
|
372 |
-
|
373 |
-
if ( ! empty($type_obj->cap->$prop) && ( in_array( $type_obj->name, array( 'post', 'page' ) )
|
374 |
-
|| ! in_array( $type_obj->cap->$prop, $default_caps )
|
375 |
-
|| ( ( 'manage_categories' == $type_obj->cap->$prop ) && ( 'manage_terms' == $prop ) && ( 'category' == $type_obj->name ) ) ) ) {
|
376 |
-
|
377 |
-
// if edit_published or edit_private cap is same as edit_posts cap, don't display a checkbox for it
|
378 |
-
if ( ( ! in_array( $prop, array( 'edit_published_posts', 'edit_private_posts', 'create_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->edit_posts ) )
|
379 |
-
&& ( ! in_array( $prop, array( 'delete_published_posts', 'delete_private_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->delete_posts ) )
|
380 |
-
&& ( ! in_array( $prop, array( 'edit_terms', 'delete_terms' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->manage_terms ) )
|
381 |
-
|
382 |
-
&& ( ! in_array( $prop, array( 'manage_terms', 'edit_terms', 'delete_terms', 'assign_terms' ) )
|
383 |
-
|| empty($cme_cap_helper->all_taxonomy_caps[$type_obj->cap->$prop])
|
384 |
-
|| ( $cme_cap_helper->all_taxonomy_caps[ $type_obj->cap->$prop ] <= 1 )
|
385 |
-
|| $type_obj->cap->$prop == str_replace( '_terms', "_{$type_obj->name}s", $prop )
|
386 |
-
|| $type_obj->cap->$prop == str_replace( '_terms', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
|
387 |
-
)
|
388 |
-
|
389 |
-
&& ( in_array( $prop, array( 'manage_terms', 'edit_terms', 'delete_terms', 'assign_terms' ) )
|
390 |
-
|| empty($cme_cap_helper->all_type_caps[$type_obj->cap->$prop])
|
391 |
-
|| ( $cme_cap_helper->all_type_caps[ $type_obj->cap->$prop ] <= 1 )
|
392 |
-
|| $type_obj->cap->$prop == 'upload_files' && 'create_posts' == $prop && 'attachment' == $type_obj->name
|
393 |
-
|| $type_obj->cap->$prop == str_replace( '_posts', "_{$type_obj->name}s", $prop )
|
394 |
-
|| $type_obj->cap->$prop == str_replace( '_pages', "_{$type_obj->name}s", $prop )
|
395 |
-
|| $type_obj->cap->$prop == str_replace( '_posts', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
|
396 |
-
|| $type_obj->cap->$prop == str_replace( '_pages', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
|
397 |
-
)
|
398 |
-
) {
|
399 |
-
// only present these term caps up top if we are ensuring that they get enforced separately from manage_terms
|
400 |
-
if ( in_array( $prop, array( 'edit_terms', 'delete_terms', 'assign_terms' ) ) && ( ! in_array( $type_obj->name, cme_get_detailed_taxonomies() ) || defined( 'OLD_PRESSPERMIT_ACTIVE' ) ) ) {
|
401 |
-
continue;
|
402 |
-
}
|
403 |
-
|
404 |
-
$cap_name = $type_obj->cap->$prop;
|
405 |
-
|
406 |
-
if ( 'taxonomy' == $item_type )
|
407 |
-
$td_classes []= "term-cap";
|
408 |
-
else
|
409 |
-
$td_classes []= "post-cap";
|
410 |
-
|
411 |
-
if ( ! empty($pp_metagroup_caps[$cap_name]) )
|
412 |
-
$td_classes []='cm-has-via-pp';
|
413 |
-
|
414 |
-
if ( $is_administrator || current_user_can($cap_name) ) {
|
415 |
-
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
416 |
-
$title = ' title="' . sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name ) . '"';
|
417 |
-
} else {
|
418 |
-
$title = ' title="' . $cap_name . '"';
|
419 |
-
}
|
420 |
-
|
421 |
-
$disabled = '';
|
422 |
-
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
423 |
-
|
424 |
-
$checkbox = '<input type="checkbox"' . $title . ' name="caps[' . $cap_name . ']" value="1" ' . $checked . $disabled . ' />';
|
425 |
-
|
426 |
-
$type_caps [$cap_name] = true;
|
427 |
-
$display_row = true;
|
428 |
-
}
|
429 |
-
} else {
|
430 |
-
//$td_classes []= "cap-unreg";
|
431 |
-
$title = 'title="' . sprintf( __( 'shared capability: %s', 'capsman-enhanced' ), esc_attr( $type_obj->cap->$prop ) ) . '"';
|
432 |
-
}
|
433 |
-
|
434 |
-
if ( isset($rcaps[$cap_name]) && empty($rcaps[$cap_name]) ) {
|
435 |
-
$td_classes []= "cap-neg";
|
436 |
-
}
|
437 |
-
} else {
|
438 |
-
$td_classes []= "cap-unreg";
|
439 |
-
}
|
440 |
-
|
441 |
-
$td_class = ( $td_classes ) ? 'class="' . implode(' ', $td_classes) . '"' : '';
|
442 |
-
|
443 |
-
$row .= "<td $td_class $title><span class='cap-x'>X</span>$checkbox";
|
444 |
-
|
445 |
-
if ( false !== strpos( $td_class, 'cap-neg' ) )
|
446 |
-
$row .= '<input type="hidden" class="cme-negation-input" name="caps[' . $cap_name . ']" value="" />';
|
447 |
-
|
448 |
-
$row .= "</td>";
|
449 |
-
}
|
450 |
-
|
451 |
-
if ('type' == $item_type) {
|
452 |
-
$type_metacaps[$type_obj->cap->read_post] = true;
|
453 |
-
$type_metacaps[$type_obj->cap->edit_post] = isset($type_obj->cap->edit_posts) && ($type_obj->cap->edit_post != $type_obj->cap->edit_posts);
|
454 |
-
$type_metacaps[$type_obj->cap->delete_post] = isset($type_obj->cap->delete_posts) && ($type_obj->cap->delete_post != $type_obj->cap->delete_posts);
|
455 |
-
|
456 |
-
} elseif ('taxonomy' == $item_type && !empty($type_obj->cap->edit_term) && !empty($type_obj->cap->delete_term)) {
|
457 |
-
$type_metacaps[$type_obj->cap->edit_term] = true;
|
458 |
-
$type_metacaps[$type_obj->cap->delete_term] = true;
|
459 |
-
}
|
460 |
-
}
|
461 |
-
|
462 |
-
if ( $display_row ) {
|
463 |
-
$row .= '</tr>';
|
464 |
-
echo $row;
|
465 |
-
}
|
466 |
-
}
|
467 |
-
|
468 |
-
echo '</table>';
|
469 |
-
|
470 |
-
} // end foreach item type
|
471 |
-
|
472 |
-
echo '</div>';
|
473 |
-
|
474 |
-
echo '</li>';
|
475 |
-
}
|
476 |
-
|
477 |
-
|
478 |
-
do_action('publishpress-caps_manager_postcaps_section', compact('current', 'rcaps', 'pp_metagroup_caps', 'is_administrator', 'default_caps', 'custom_types', 'defined', 'unfiltered', 'pp_metagroup_caps'));
|
479 |
-
|
480 |
-
$type_caps = apply_filters('publishpress_caps_manager_typecaps', $type_caps);
|
481 |
-
|
482 |
-
echo '</ul>';
|
483 |
-
|
484 |
-
// clicking on post type name toggles corresponding checkbox selections
|
485 |
-
?>
|
486 |
-
<script type="text/javascript">
|
487 |
-
/* <![CDATA[ */
|
488 |
-
jQuery(document).ready( function($) {
|
489 |
-
$('a[href="#toggle_type_caps"]').click( function() {
|
490 |
-
var chks = $(this).closest('tr').find('input');
|
491 |
-
$(chks).prop( 'checked', ! $(chks).first().is(':checked') );
|
492 |
-
return false;
|
493 |
-
});
|
494 |
-
});
|
495 |
-
/* ]]> */
|
496 |
-
</script>
|
497 |
-
<?php
|
498 |
-
|
499 |
-
echo '<p> </p><h3>' . __( 'Other WordPress Core Capabilities', 'capsman-enhanced' ) . '</h3>';
|
500 |
-
echo '<table class="form-table cme-checklist"><tr>';
|
501 |
-
|
502 |
-
$checks_per_row = get_option( 'cme_form-rows', 5 );
|
503 |
-
$i = 0; $first_row = true;
|
504 |
-
|
505 |
-
$core_caps = _cme_core_caps();
|
506 |
-
foreach( array_keys($core_caps) as $cap_name ) {
|
507 |
-
if ( ! $is_administrator && ! current_user_can($cap_name) )
|
508 |
-
continue;
|
509 |
-
|
510 |
-
if ( $i == $checks_per_row ) {
|
511 |
-
echo '</tr><tr>';
|
512 |
-
$i = 0;
|
513 |
-
}
|
514 |
-
|
515 |
-
if ( ! isset( $rcaps[$cap_name] ) )
|
516 |
-
$class = 'cap-no';
|
517 |
-
else
|
518 |
-
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
|
519 |
-
|
520 |
-
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
521 |
-
$class .= ' cap-metagroup';
|
522 |
-
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
|
523 |
-
} else {
|
524 |
-
$title_text = $cap_name;
|
525 |
-
}
|
526 |
-
|
527 |
-
$disabled = '';
|
528 |
-
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
529 |
-
$lock_capability = false;
|
530 |
-
$title = $title_text;
|
531 |
-
|
532 |
-
if ( 'read' == $cap_name ) {
|
533 |
-
if ( ! empty( $block_read_removal ) ) {
|
534 |
-
// prevent the read capability from being removed from a core role, but don't force it to be added
|
535 |
-
if ( $checked || apply_filters( 'pp_caps_force_capability_storage', false, 'read', $default ) ) {
|
536 |
-
if ( apply_filters( 'pp_caps_lock_capability', true, 'read', $default ) ) {
|
537 |
-
$lock_capability = true;
|
538 |
-
$class .= ' cap-locked';
|
539 |
-
$disabled = 'disabled="disabled"';
|
540 |
-
if ( 'administrator' != $this->current ) {
|
541 |
-
$title = esc_attr( __('Lockout Prevention: To remove read capability, first remove WordPress admin / editing capabilities, or add "dashboard_lockout_ok" capability', 'capsman-enhanced' ) );
|
542 |
-
}
|
543 |
-
}
|
544 |
-
}
|
545 |
-
}
|
546 |
-
}
|
547 |
-
|
548 |
-
?>
|
549 |
-
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
|
550 |
-
<span>
|
551 |
-
<?php
|
552 |
-
echo str_replace( '_', ' ', $cap_name );
|
553 |
-
?>
|
554 |
-
</span></label><a href="#" class="neg-cap"> x </a>
|
555 |
-
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
|
556 |
-
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
|
557 |
-
<?php endif; ?>
|
558 |
-
</td>
|
559 |
-
|
560 |
-
<?php
|
561 |
-
|
562 |
-
if ( $lock_capability ) {
|
563 |
-
echo '<input type="hidden" name="caps[' . $cap_name . ']" value="1" />';
|
564 |
-
}
|
565 |
-
|
566 |
-
++$i;
|
567 |
-
}
|
568 |
-
|
569 |
-
if ( $i == $checks_per_row ) {
|
570 |
-
echo '</tr>';
|
571 |
-
$i = 0;
|
572 |
-
} elseif ( ! $first_row ) {
|
573 |
-
// Now close a wellformed table
|
574 |
-
for ( $i; $i < $checks_per_row; $i++ ){
|
575 |
-
echo '<td> </td>';
|
576 |
-
}
|
577 |
-
echo '</tr>';
|
578 |
-
}
|
579 |
-
?>
|
580 |
-
|
581 |
-
<tr class="cme-bulk-select">
|
582 |
-
<td colspan="<?php echo $checks_per_row;?>">
|
583 |
-
<span style="float:right">
|
584 |
-
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>"> <a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
|
585 |
-
</span>
|
586 |
-
</td></tr>
|
587 |
-
|
588 |
-
</table>
|
589 |
-
<?php
|
590 |
-
$all_capabilities = apply_filters( 'capsman_get_capabilities', array_keys( $this->capabilities ), $this->ID );
|
591 |
-
$all_capabilities = apply_filters( 'members_get_capabilities', $all_capabilities );
|
592 |
-
|
593 |
-
/*
|
594 |
-
$publishpress_status_change_caps = array();
|
595 |
-
foreach( $all_capabilities as $cap_name ) {
|
596 |
-
if (0 === strpos($cap_name, 'status_change_')) {
|
597 |
-
$publishpress_status_change_caps []= $cap_name;
|
598 |
-
}
|
599 |
-
}
|
600 |
-
*/
|
601 |
-
|
602 |
-
$plugin_caps = [];
|
603 |
-
|
604 |
-
if (defined('PUBLISHPRESS_VERSION')) {
|
605 |
-
$plugin_caps['PublishPress'] = apply_filters('cme_publishpress_capabilities',
|
606 |
-
|
607 |
-
'edit_metadata',
|
608 |
-
'edit_post_subscriptions',
|
609 |
-
'ppma_edit_orphan_post',
|
610 |
-
'pp_manage_roles',
|
611 |
-
'pp_set_notification_channel',
|
612 |
-
'pp_view_calendar',
|
613 |
-
'pp_view_content_overview',
|
614 |
-
'status_change',
|
615 |
-
)
|
616 |
-
);
|
617 |
-
}
|
618 |
-
|
619 |
-
if (defined('PUBLISHPRESS_MULTIPLE_AUTHORS_VERSION')) {
|
620 |
-
if ($_caps = apply_filters('cme_multiple_authors_capabilities', array())) {
|
621 |
-
$plugin_caps['PublishPress Authors'] = $_caps;
|
622 |
-
}
|
623 |
-
}
|
624 |
-
|
625 |
-
if (defined('PRESSPERMIT_VERSION')) {
|
626 |
-
$plugin_caps['PublishPress Permissions'] = apply_filters('cme_presspermit_capabilities',
|
627 |
-
array(
|
628 |
-
'edit_own_attachments',
|
629 |
-
'list_others_unattached_files',
|
630 |
-
'pp_administer_content',
|
631 |
-
'pp_assign_roles',
|
632 |
-
'pp_associate_any_page',
|
633 |
-
'pp_create_groups',
|
634 |
-
'pp_create_network_groups',
|
635 |
-
'pp_define_moderation',
|
636 |
-
'pp_define_post_status',
|
637 |
-
'pp_define_privacy',
|
638 |
-
'pp_delete_groups',
|
639 |
-
'pp_edit_groups',
|
640 |
-
'pp_exempt_edit_circle',
|
641 |
-
'pp_exempt_read_circle',
|
642 |
-
'pp_force_quick_edit',
|
643 |
-
'pp_list_all_files',
|
644 |
-
'pp_manage_capabilities',
|
645 |
-
'pp_manage_members',
|
646 |
-
'pp_manage_network_members',
|
647 |
-
'pp_manage_settings',
|
648 |
-
'pp_moderate_any',
|
649 |
-
'pp_set_associate_exceptions',
|
650 |
-
'pp_set_edit_exceptions',
|
651 |
-
'pp_set_read_exceptions',
|
652 |
-
'pp_set_revise_exceptions',
|
653 |
-
'pp_set_term_assign_exceptions',
|
654 |
-
'pp_set_term_associate_exceptions',
|
655 |
-
'pp_set_term_manage_exceptions',
|
656 |
-
'pp_unfiltered',
|
657 |
-
'set_posts_status',
|
658 |
-
)
|
659 |
-
);
|
660 |
-
}
|
661 |
-
|
662 |
-
if (defined('WC_PLUGIN_FILE')) {
|
663 |
-
$plugin_caps['WooCommerce'] = apply_filters('cme_woocommerce_capabilities',
|
664 |
-
array(
|
665 |
-
'assign_product_terms',
|
666 |
-
'assign_shop_coupon_terms',
|
667 |
-
'assign_shop_discount_terms',
|
668 |
-
'assign_shop_order_terms',
|
669 |
-
'assign_shop_payment_terms',
|
670 |
-
'create_shop_orders',
|
671 |
-
'delete_others_products',
|
672 |
-
'delete_others_shop_coupons',
|
673 |
-
'delete_others_shop_discounts',
|
674 |
-
'delete_others_shop_orders',
|
675 |
-
'delete_others_shop_payments',
|
676 |
-
'delete_private_products',
|
677 |
-
'delete_private_shop_coupons',
|
678 |
-
'delete_private_shop_orders',
|
679 |
-
'delete_private_shop_discounts',
|
680 |
-
'delete_private_shop_payments',
|
681 |
-
'delete_product_terms',
|
682 |
-
'delete_products',
|
683 |
-
'delete_published_products',
|
684 |
-
'delete_published_shop_coupons',
|
685 |
-
'delete_published_shop_discounts',
|
686 |
-
'delete_published_shop_orders',
|
687 |
-
'delete_published_shop_payments',
|
688 |
-
'delete_shop_coupons',
|
689 |
-
'delete_shop_coupon_terms',
|
690 |
-
'delete_shop_discount_terms',
|
691 |
-
'delete_shop_discounts',
|
692 |
-
'delete_shop_order_terms',
|
693 |
-
'delete_shop_orders',
|
694 |
-
'delete_shop_payments',
|
695 |
-
'delete_shop_payment_terms',
|
696 |
-
'edit_others_products',
|
697 |
-
'edit_others_shop_coupons',
|
698 |
-
'edit_others_shop_discounts',
|
699 |
-
'edit_others_shop_orders',
|
700 |
-
'edit_others_shop_payments',
|
701 |
-
'edit_private_products',
|
702 |
-
'edit_private_shop_coupons',
|
703 |
-
'edit_private_shop_discounts',
|
704 |
-
'edit_private_shop_orders',
|
705 |
-
'edit_private_shop_payments',
|
706 |
-
'edit_product_terms',
|
707 |
-
'edit_products',
|
708 |
-
'edit_published_products',
|
709 |
-
'edit_published_shop_coupons',
|
710 |
-
'edit_published_shop_discounts',
|
711 |
-
'edit_published_shop_orders',
|
712 |
-
'edit_published_shop_payments',
|
713 |
-
'edit_shop_coupon_terms',
|
714 |
-
'edit_shop_coupons',
|
715 |
-
'edit_shop_discounts',
|
716 |
-
'edit_shop_discount_terms',
|
717 |
-
'edit_shop_order_terms',
|
718 |
-
'edit_shop_orders',
|
719 |
-
'edit_shop_payments',
|
720 |
-
'edit_shop_payment_terms',
|
721 |
-
'export_shop_payments',
|
722 |
-
'export_shop_reports',
|
723 |
-
'import_shop_discounts',
|
724 |
-
'import_shop_payments',
|
725 |
-
'manage_product_terms',
|
726 |
-
'manage_shop_coupon_terms',
|
727 |
-
'manage_shop_discounts',
|
728 |
-
'manage_shop_discount_terms',
|
729 |
-
'manage_shop_payment_terms',
|
730 |
-
'manage_shop_order_terms',
|
731 |
-
'manage_shop_settings',
|
732 |
-
'manage_woocommerce',
|
733 |
-
'publish_products',
|
734 |
-
'publish_shop_coupons',
|
735 |
-
'publish_shop_discounts',
|
736 |
-
'publish_shop_orders',
|
737 |
-
'publish_shop_payments',
|
738 |
-
'read_private_products',
|
739 |
-
'read_private_shop_coupons',
|
740 |
-
'read_private_shop_discounts',
|
741 |
-
'read_private_shop_payments',
|
742 |
-
'read_private_shop_orders',
|
743 |
-
'view_admin_dashboard',
|
744 |
-
'view_shop_discount_stats',
|
745 |
-
'view_shop_payment_stats',
|
746 |
-
'view_shop_reports',
|
747 |
-
'view_shop_sensitive_data',
|
748 |
-
'view_woocommerce_reports',
|
749 |
-
)
|
750 |
-
|
751 |
-
}
|
752 |
-
|
753 |
-
$plugin_caps = apply_filters('cme_plugin_capabilities', $plugin_caps);
|
754 |
-
|
755 |
-
foreach($plugin_caps as $plugin => $__plugin_caps) {
|
756 |
-
$_plugin_caps = array_fill_keys($__plugin_caps, true);
|
757 |
-
|
758 |
-
echo '<h3 class="cme-cap-section">' . sprintf(__( '%s Capabilities', 'capsman-enhanced' ), str_replace('_', ' ', $plugin )) . '</h3>';
|
759 |
-
echo '<table class="form-table cme-checklist"><tr>';
|
760 |
-
|
761 |
-
$checks_per_row = get_option( 'cme_form-rows', 5 );
|
762 |
-
$i = 0; $first_row = true;
|
763 |
-
|
764 |
-
foreach( array_keys($_plugin_caps) as $cap_name ) {
|
765 |
-
if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) || isset($type_metacaps[$cap_name]) ) {
|
766 |
-
continue;
|
767 |
-
}
|
768 |
-
|
769 |
-
if ( ! $is_administrator && ! current_user_can($cap_name) )
|
770 |
-
continue;
|
771 |
-
|
772 |
-
if ( $i == $checks_per_row ) {
|
773 |
-
echo '</tr><tr>';
|
774 |
-
$i = 0;
|
775 |
-
}
|
776 |
-
|
777 |
-
if ( ! isset( $rcaps[$cap_name] ) )
|
778 |
-
$class = 'cap-no';
|
779 |
-
else
|
780 |
-
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
|
781 |
-
|
782 |
-
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
783 |
-
$class .= ' cap-metagroup';
|
784 |
-
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
|
785 |
-
} else {
|
786 |
-
$title_text = $cap_name;
|
787 |
-
}
|
788 |
-
|
789 |
-
$disabled = '';
|
790 |
-
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
791 |
-
$title = $title_text;
|
792 |
-
?>
|
793 |
-
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
|
794 |
-
<span>
|
795 |
-
<?php
|
796 |
-
echo str_replace( '_', ' ', $cap_name );
|
797 |
-
?>
|
798 |
-
</span></label><a href="#" class="neg-cap"> x </a>
|
799 |
-
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
|
800 |
-
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
|
801 |
-
<?php endif; ?>
|
802 |
-
</td>
|
803 |
-
|
804 |
-
<?php
|
805 |
-
++$i;
|
806 |
-
}
|
807 |
-
|
808 |
-
if ( $i == $checks_per_row ) {
|
809 |
-
echo '</tr>';
|
810 |
-
$i = 0;
|
811 |
-
} elseif ( ! $first_row ) {
|
812 |
-
// Now close a wellformed table
|
813 |
-
for ( $i; $i < $checks_per_row; $i++ ){
|
814 |
-
echo '<td> </td>';
|
815 |
-
}
|
816 |
-
echo '</tr>';
|
817 |
-
}
|
818 |
-
?>
|
819 |
-
|
820 |
-
<tr class="cme-bulk-select">
|
821 |
-
<td colspan="<?php echo $checks_per_row;?>">
|
822 |
-
<span style="float:right">
|
823 |
-
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>"> <a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
|
824 |
-
</span>
|
825 |
-
</td></tr>
|
826 |
-
|
827 |
-
</table>
|
828 |
-
<?php
|
829 |
-
}
|
830 |
-
|
831 |
-
echo '<p> </p><h3 class="cme-cap-section">' . __( 'Additional Capabilities', 'capsman-enhanced' ) . '</h3>';
|
832 |
-
|
833 |
-
?>
|
834 |
-
<table class="form-table cme-checklist">
|
835 |
-
<tr>
|
836 |
-
<?php
|
837 |
-
$i = 0; $first_row = true;
|
838 |
-
|
839 |
-
foreach( $all_capabilities as $cap_name ) {
|
840 |
-
if ( ! isset($this->capabilities[$cap_name]) )
|
841 |
-
$this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
|
842 |
-
}
|
843 |
-
|
844 |
-
uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
|
845 |
-
|
846 |
-
$additional_caps = apply_filters('publishpress_caps_manage_additional_caps', $this->capabilities);
|
847 |
-
|
848 |
-
foreach ($additional_caps as $cap_name => $cap) :
|
849 |
-
if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) || isset($type_metacaps[$cap_name]) )
|
850 |
-
continue;
|
851 |
-
|
852 |
-
foreach(array_keys($plugin_caps) as $plugin) {
|
853 |
-
if ( in_array( $cap_name, $plugin_caps[$plugin]) ) {
|
854 |
-
continue 2;
|
855 |
-
}
|
856 |
-
}
|
857 |
-
|
858 |
-
if ( ! $is_administrator && empty( $current_user->allcaps[$cap_name] ) ) {
|
859 |
-
continue;
|
860 |
-
}
|
861 |
-
|
862 |
-
// Levels are not shown.
|
863 |
-
if ( preg_match( '/^level_(10|[0-9])$/i', $cap_name ) ) {
|
864 |
-
continue;
|
865 |
-
}
|
866 |
-
|
867 |
-
if ( $i == $checks_per_row ) {
|
868 |
-
echo '</tr><tr>';
|
869 |
-
$i = 0; $first_row = false;
|
870 |
-
}
|
871 |
-
|
872 |
-
if ( ! isset( $rcaps[$cap_name] ) )
|
873 |
-
$class = 'cap-no';
|
874 |
-
else
|
875 |
-
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
|
876 |
-
|
877 |
-
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
878 |
-
$class .= ' cap-metagroup';
|
879 |
-
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
|
880 |
-
} else {
|
881 |
-
$title_text = $cap_name;
|
882 |
-
}
|
883 |
-
|
884 |
-
$disabled = '';
|
885 |
-
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
886 |
-
|
887 |
-
if ( 'manage_capabilities' == $cap_name ) {
|
888 |
-
if (
|
889 |
-
continue;
|
890 |
-
} elseif ( 'administrator' == $default ) {
|
891 |
-
$class .= ' cap-locked';
|
892 |
-
$lock_manage_caps_capability = true;
|
893 |
-
$disabled = 'disabled="disabled"';
|
894 |
-
}
|
895 |
-
}
|
896 |
-
?>
|
897 |
-
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
|
898 |
-
<span>
|
899 |
-
<?php
|
900 |
-
echo str_replace( '_', ' ', $cap );
|
901 |
-
?>
|
902 |
-
</span></label><a href="#" class="neg-cap"> x </a>
|
903 |
-
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
|
904 |
-
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
|
905 |
-
<?php endif; ?>
|
906 |
-
</td>
|
907 |
-
<?php
|
908 |
-
$i++;
|
909 |
-
endforeach;
|
910 |
-
|
911 |
-
if ( ! empty($lock_manage_caps_capability) ) {
|
912 |
-
echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
|
913 |
-
}
|
914 |
-
|
915 |
-
if ( $i == $checks_per_row ) {
|
916 |
-
echo '</tr><tr>';
|
917 |
-
$i = 0;
|
918 |
-
} else {
|
919 |
-
if ( ! $first_row ) {
|
920 |
-
// Now close a wellformed table
|
921 |
-
for ( $i; $i < $checks_per_row; $i++ ){
|
922 |
-
echo '<td> </td>';
|
923 |
-
}
|
924 |
-
echo '</tr>';
|
925 |
-
}
|
926 |
-
}
|
927 |
-
?>
|
928 |
-
|
929 |
-
<tr class="cme-bulk-select">
|
930 |
-
<td colspan="<?php echo $checks_per_row;?>">
|
931 |
-
<span style="float:right">
|
932 |
-
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>"> <a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
|
933 |
-
</span>
|
934 |
-
</td></tr>
|
935 |
-
|
936 |
-
</table>
|
937 |
-
|
938 |
-
<?php
|
939 |
-
if (array_intersect(array_keys(array_filter($type_metacaps)), $all_capabilities)) {
|
940 |
-
|
941 |
-
$_title = esc_attr(__('Meta capabilities are used in code as placeholders for other capabilities. Assiging to a role has no effect.'));
|
942 |
-
echo '<p> </p><h3 class="cme-cap-section" title="' . $_title . '">' . __( 'Invalid Capabilities', 'capsman-enhanced' ) . '</h3>';
|
943 |
-
?>
|
944 |
-
<table class="form-table cme-checklist">
|
945 |
-
<tr>
|
946 |
-
<?php
|
947 |
-
$i = 0; $first_row = true;
|
948 |
-
|
949 |
-
foreach( $all_capabilities as $cap_name ) {
|
950 |
-
if ( ! isset($this->capabilities[$cap_name]) )
|
951 |
-
$this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
|
952 |
-
}
|
953 |
-
|
954 |
-
uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
|
955 |
-
|
956 |
-
foreach ( $this->capabilities as $cap_name => $cap ) :
|
957 |
-
if ( ! isset( $type_metacaps[$cap_name] ) )
|
958 |
-
continue;
|
959 |
-
|
960 |
-
if ( ! $is_administrator && empty( $current_user->allcaps[$cap_name] ) ) {
|
961 |
-
continue;
|
962 |
-
}
|
963 |
-
|
964 |
-
if ( $i == $checks_per_row ) {
|
965 |
-
echo '</tr><tr>';
|
966 |
-
$i = 0; $first_row = false;
|
967 |
-
}
|
968 |
-
|
969 |
-
if ( ! isset( $rcaps[$cap_name] ) )
|
970 |
-
$class = 'cap-no';
|
971 |
-
else
|
972 |
-
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
|
973 |
-
|
974 |
-
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
975 |
-
$class .= ' cap-metagroup';
|
976 |
-
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
|
977 |
-
} else {
|
978 |
-
$title_text = $cap_name;
|
979 |
-
}
|
980 |
-
|
981 |
-
$disabled = '';
|
982 |
-
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
983 |
-
?>
|
984 |
-
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
|
985 |
-
<span>
|
986 |
-
<?php
|
987 |
-
echo str_replace( '_', ' ', $cap );
|
988 |
-
?>
|
989 |
-
</span></label><a href="#" class="neg-cap"> x </a>
|
990 |
-
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
|
991 |
-
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
|
992 |
-
<?php endif; ?>
|
993 |
-
</td>
|
994 |
-
<?php
|
995 |
-
$i++;
|
996 |
-
endforeach;
|
997 |
-
|
998 |
-
if ( ! empty($lock_manage_caps_capability) ) {
|
999 |
-
echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
|
1000 |
-
}
|
1001 |
-
|
1002 |
-
if ( $i == $checks_per_row ) {
|
1003 |
-
echo '</tr><tr>';
|
1004 |
-
$i = 0;
|
1005 |
-
} else {
|
1006 |
-
if ( ! $first_row ) {
|
1007 |
-
// Now close a wellformed table
|
1008 |
-
for ( $i; $i < $checks_per_row; $i++ ){
|
1009 |
-
echo '<td> </td>';
|
1010 |
-
}
|
1011 |
-
echo '</tr>';
|
1012 |
-
}
|
1013 |
-
}
|
1014 |
-
?>
|
1015 |
-
|
1016 |
-
<tr class="cme-bulk-select">
|
1017 |
-
<td colspan="<?php echo $checks_per_row;?>">
|
1018 |
-
<span style="float:right">
|
1019 |
-
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>"> <a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
|
1020 |
-
</span>
|
1021 |
-
</td></tr>
|
1022 |
-
|
1023 |
-
</table>
|
1024 |
-
<?php
|
1025 |
-
} // endif any invalid caps
|
1026 |
-
?>
|
1027 |
-
|
1028 |
-
<div>
|
1029 |
-
<?php
|
1030 |
-
$level = ak_caps2level($rcaps);
|
1031 |
-
?>
|
1032 |
-
<span title="<?php _e('Role level is mostly deprecated. However, it still determines eligibility for Post Author assignment and limits the application of user editing capabilities.', 'capsman-enhanced');?>">
|
1033 |
-
<?php _e('Role Level:', 'capsman-enhanced');?> <select name="level">
|
1034 |
-
<?php for ( $l = $this->max_level; $l >= 0; $l-- ) {?>
|
1035 |
-
<option value="<?php echo $l; ?>" style="text-align:right;"<?php selected($level, $l); ?>> <?php echo $l; ?> </option>
|
1036 |
-
<?php }
|
1037 |
-
?>
|
1038 |
-
</select>
|
1039 |
-
</span>
|
1040 |
-
|
1041 |
-
</div>
|
1042 |
-
</dd>
|
1043 |
-
</dl>
|
1044 |
-
|
1045 |
-
<?php
|
1046 |
-
$support_pp_only_roles = ( defined('PRESSPERMIT_ACTIVE') ) ? $pp_ui->pp_only_roles_ui( $default ) : false;
|
1047 |
-
cme_network_role_ui( $default );
|
1048 |
-
?>
|
1049 |
-
|
1050 |
-
<p class="submit">
|
1051 |
-
<input type="hidden" name="action" value="update" />
|
1052 |
-
<input type="hidden" name="current" value="<?php echo $default; ?>" />
|
1053 |
-
<input type="submit" name="SaveRole" value="<?php _e('Save Changes', 'capsman-enhanced') ?>" class="button-primary" />
|
1054 |
-
|
1055 |
-
<?php if ( current_user_can('administrator') && 'administrator' != $default ) : ?>
|
1056 |
-
<a class="ak-delete" title="<?php echo esc_attr(__('Delete this role', 'capsman-enhanced')) ?>" href="<?php echo wp_nonce_url("admin.php?page={$this->ID}&action=delete&role={$default}", 'delete-role_' . $default); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete the %s role.\n\n 'Cancel' to stop, 'OK' to delete.", 'capsman-enhanced'), $roles[$default])); ?>') ) { return true;}return false;"><?php _e('Delete Role', 'capsman-enhanced')?></a>
|
1057 |
-
<?php endif; ?>
|
1058 |
-
</p>
|
1059 |
-
|
1060 |
-
</td>
|
1061 |
-
<td class="sidebar">
|
1062 |
-
<dl>
|
1063 |
-
<dt><?php if ( defined('WPLANG') && WPLANG ) _e('Select New Role', 'capsman-enhanced'); else echo('Select Role to View / Edit'); ?></dt>
|
1064 |
-
<dd style="text-align:center;">
|
1065 |
-
<p><select name="role">
|
1066 |
-
<?php
|
1067 |
-
foreach ( $roles as $role => $name ) {
|
1068 |
-
$name = translate_user_role($name);
|
1069 |
-
echo '<option value="' . $role .'"'; selected($default, $role); echo '> ' . $name . ' </option>';
|
1070 |
-
}
|
1071 |
-
?>
|
1072 |
-
</select><span style="margin-left:20px"><input type="submit" name="LoadRole" value="<?php if ( defined('WPLANG') && WPLANG ) _e('Change', 'capsman-enhanced'); else echo('Load'); ?>" class="button" /></span></p>
|
1073 |
-
</dd>
|
1074 |
-
</dl>
|
1075 |
-
|
1076 |
-
<script type="text/javascript">
|
1077 |
-
/* <![CDATA[ */
|
1078 |
-
jQuery(document).ready( function($) {
|
1079 |
-
$('select[name="role"]').val('<?php echo $default;?>');
|
1080 |
-
|
1081 |
-
$('input.button[name="LoadRole"]').click(function(){
|
1082 |
-
$('#publishpress_caps_form').attr('action', 'admin.php?page=capsman&role=' + $('select[name="role"]').val());
|
1083 |
-
});
|
1084 |
-
});
|
1085 |
-
/* ]]> */
|
1086 |
-
</script>
|
1087 |
-
|
1088 |
-
<?php do_action('publishpress-caps_sidebar_top');?>
|
1089 |
-
|
1090 |
-
<dl>
|
1091 |
-
<dt><?php _e('Create New Role', 'capsman-enhanced'); ?></dt>
|
1092 |
-
<dd style="text-align:center;">
|
1093 |
-
<?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
|
1094 |
-
<p><input type="text" name="create-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
|
1095 |
-
|
1096 |
-
<?php if( $support_pp_only_roles ) : ?>
|
1097 |
-
<label for="new_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="new_role_pp_only" id="new_role_pp_only" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
|
1098 |
-
<?php endif; ?>
|
1099 |
-
|
1100 |
-
<br />
|
1101 |
-
<input type="submit" name="CreateRole" value="<?php _e('Create', 'capsman-enhanced') ?>" class="button" />
|
1102 |
-
</p>
|
1103 |
-
</dd>
|
1104 |
-
</dl>
|
1105 |
-
|
1106 |
-
<dl>
|
1107 |
-
<dt><?php defined('WPLANG') && WPLANG ? _e('Copy this role to', 'capsman-enhanced') : printf('Copy %s Role', translate_user_role($roles[$default])); ?></dt>
|
1108 |
-
<dd style="text-align:center;">
|
1109 |
-
<?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
|
1110 |
-
<p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
|
1111 |
-
|
1112 |
-
<?php if( $support_pp_only_roles ) : ?>
|
1113 |
-
<label for="copy_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="copy_role_pp_only" id="copy_role_pp_only" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
|
1114 |
-
<?php endif; ?>
|
1115 |
-
|
1116 |
-
<br />
|
1117 |
-
<input type="submit" name="CopyRole" value="<?php _e('Copy', 'capsman-enhanced') ?>" class="button" />
|
1118 |
-
</p>
|
1119 |
-
</dd>
|
1120 |
-
</dl>
|
1121 |
-
|
1122 |
-
<dl>
|
1123 |
-
<dt><?php _e('Add Capability', 'capsman-enhanced'); ?></dt>
|
1124 |
-
<dd style="text-align:center;">
|
1125 |
-
<p><input type="text" name="capability-name" class="regular-text" placeholder="<?php echo 'capability_name';?>" /><br />
|
1126 |
-
<input type="submit" name="AddCap" value="<?php _e('Add to role', 'capsman-enhanced') ?>" class="button" /></p>
|
1127 |
-
</dd>
|
1128 |
-
</dl>
|
1129 |
-
|
1130 |
-
<!-- <dl class="cme-backup-tool">
|
1131 |
-
<dt><?php _e('Backup Tool', 'capsman-enhanced'); ?></dt>
|
1132 |
-
<dd style="text-align:center;">
|
1133 |
-
<p><a href="admin.php?page=capsman-tool"><?php _e('Backup / Restore Roles', 'capsman-enhanced');?></a></p>
|
1134 |
-
</dd>
|
1135 |
-
</dl> -->
|
1136 |
-
|
1137 |
-
<dl>
|
1138 |
-
<dt><?php _e('Related Permissions Plugins', 'capsman-enhanced'); ?></dt>
|
1139 |
-
<dd>
|
1140 |
-
<ul>
|
1141 |
-
<li><a href="https://publishpress.com/ma/" target="_blank"><?php _e('Multiple Authors', 'capsman-enhanced');?></a></li>
|
1142 |
-
</li>
|
1143 |
-
|
1144 |
-
<li><a href="#pp-more"><?php _e('PublishPress Permissions', 'capsman-enhanced');?></a>
|
1145 |
-
</li>
|
1146 |
-
|
1147 |
-
<?php $_url = "plugin-install.php?tab=plugin-information&plugin=publishpress&TB_iframe=true&width=640&height=678";
|
1148 |
-
$url = ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
|
1149 |
-
?>
|
1150 |
-
<li><a class="thickbox" href="<?php echo $url;?>"><?php _e('PublishPress', 'capsman-enhanced');?></a></li>
|
1151 |
-
|
1152 |
-
<?php $_url = "plugin-install.php?tab=plugin-information&plugin=revisionary&TB_iframe=true&width=640&height=678";
|
1153 |
-
$url = ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
|
1154 |
-
?>
|
1155 |
-
<li><a class="thickbox" href="<?php echo $url;?>"><?php _e('PublishPress Revisions', 'capsman-enhanced');?></a></li>
|
1156 |
-
|
1157 |
-
<li class="publishpress-contact"><a href="https://publishpress.com/contact" target="_blank"><?php _e('Help / Contact Form', 'capsman-enhanced');?></a></li>
|
1158 |
-
|
1159 |
-
</ul>
|
1160 |
-
</dd>
|
1161 |
-
</dl>
|
1162 |
-
|
1163 |
-
<?php
|
1164 |
-
$pp_ui->pp_types_ui( $defined['type'] );
|
1165 |
-
$pp_ui->pp_taxonomies_ui( $defined['taxonomy'] );
|
1166 |
-
|
1167 |
-
do_action('publishpress-caps_sidebar_bottom');
|
1168 |
-
?>
|
1169 |
-
</td>
|
1170 |
-
</tr>
|
1171 |
-
</table>
|
1172 |
-
</fieldset>
|
1173 |
-
</form>
|
1174 |
-
|
1175 |
-
<?php if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') || get_option('cme_display_branding')) {
|
1176 |
-
cme_publishpressFooter();
|
1177 |
-
}
|
1178 |
-
?>
|
1179 |
-
</div>
|
1180 |
-
|
1181 |
-
<?php
|
1182 |
-
function cme_network_role_ui( $default ) {
|
1183 |
-
if ( ! is_multisite() || ! is_super_admin() || ( 1 != get_current_blog_id() ) )
|
1184 |
-
return false;
|
1185 |
-
?>
|
1186 |
-
|
1187 |
-
<div style="float:right;margin-left:10px;margin-right:10px">
|
1188 |
-
<?php
|
1189 |
-
if ( ! $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) )
|
1190 |
-
$autocreate_roles = array();
|
1191 |
-
|
1192 |
-
$checked = ( in_array( $default, $autocreate_roles ) ) ? 'checked="checked"': '';
|
1193 |
-
?>
|
1194 |
-
<div style="margin-bottom: 5px">
|
1195 |
-
<label for="cme_autocreate_role" title="<?php _e('Create this role definition in new (future) sites', 'capsman-enhanced');?>"><input type="checkbox" name="cme_autocreate_role" id="cme_autocreate_role" value="1" <?php echo $checked;?>> <?php _e('include in new sites', 'capsman-enhanced'); ?> </label>
|
1196 |
-
</div>
|
1197 |
-
<div>
|
1198 |
-
<label for="cme_net_sync_role" title="<?php echo esc_attr(__('Copy / update this role definition to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_role" id="cme_net_sync_role" value="1"> <?php _e('sync role to all sites now', 'capsman-enhanced'); ?> </label>
|
1199 |
-
</div>
|
1200 |
-
</div>
|
1201 |
-
<?php
|
1202 |
-
return true;
|
1203 |
-
}
|
1204 |
-
|
1205 |
-
function cme_plugin_info_url( $plugin_slug ) {
|
1206 |
-
$_url = "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678";
|
1207 |
-
return ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
|
1208 |
-
}
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* General Admin for Role Capabilities.
|
4 |
+
* Provides admin pages to create and manage roles and capabilities.
|
5 |
+
*
|
6 |
+
* @author Jordi Canals, Kevin Behrens
|
7 |
+
* @copyright Copyright (C) 2009, 2010 Jordi Canals, (C) 2020 PublishPress
|
8 |
+
* @license GNU General Public License version 2
|
9 |
+
* @link https://publishpress.com
|
10 |
+
*
|
11 |
+
*
|
12 |
+
* Copyright 2009, 2010 Jordi Canals <devel@jcanals.cat>
|
13 |
+
* Modifications Copyright 2020, PublishPress <help@publishpress.com>
|
14 |
+
*
|
15 |
+
* This program is free software; you can redistribute it and/or
|
16 |
+
* modify it under the terms of the GNU General Public License
|
17 |
+
* version 2 as published by the Free Software Foundation.
|
18 |
+
*
|
19 |
+
* This program is distributed in the hope that it will be useful,
|
20 |
+
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
21 |
+
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
22 |
+
* GNU General Public License for more details.
|
23 |
+
*
|
24 |
+
* You should have received a copy of the GNU General Public License
|
25 |
+
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
26 |
+
**/
|
27 |
+
|
28 |
+
global $capsman, $cme_cap_helper, $current_user;
|
29 |
+
|
30 |
+
do_action('publishpress-caps_manager-load');
|
31 |
+
|
32 |
+
$roles = $this->roles;
|
33 |
+
$default = $this->current;
|
34 |
+
|
35 |
+
if ( $block_read_removal = _cme_is_read_removal_blocked( $this->current ) ) {
|
36 |
+
if ( $current = get_role($default) ) {
|
37 |
+
if ( empty( $current->capabilities['read'] ) ) {
|
38 |
+
ak_admin_error( sprintf( __( 'Warning: This role cannot access the dashboard without the read capability. %1$sClick here to fix this now%2$s.', 'capsman-enhanced' ), '<a href="javascript:void(0)" class="cme-fix-read-cap">', '</a>' ) );
|
39 |
+
}
|
40 |
+
}
|
41 |
+
}
|
42 |
+
|
43 |
+
require_once( dirname(__FILE__).'/pp-ui.php' );
|
44 |
+
$pp_ui = new Capsman_PP_UI();
|
45 |
+
|
46 |
+
if( defined('PRESSPERMIT_ACTIVE') ) {
|
47 |
+
$pp_metagroup_caps = $pp_ui->get_metagroup_caps( $default );
|
48 |
+
} else {
|
49 |
+
$pp_metagroup_caps = array();
|
50 |
+
}
|
51 |
+
?>
|
52 |
+
<div class="wrap publishpress-caps-manage pressshack-admin-wrapper">
|
53 |
+
<?php if( defined('PRESSPERMIT_ACTIVE') ) :
|
54 |
+
pp_icon();
|
55 |
+
$style = 'style="height:60px;"';
|
56 |
+
?>
|
57 |
+
<?php else:
|
58 |
+
$style = '';
|
59 |
+
?>
|
60 |
+
<div id="icon-capsman-admin" class="icon32"></div>
|
61 |
+
<?php endif; ?>
|
62 |
+
|
63 |
+
<h1 <?php echo $style;?>><?php _e('Role Capabilities', 'capsman-enhanced') ?></h1>
|
64 |
+
|
65 |
+
<form id="publishpress_caps_form" method="post" action="admin.php?page=<?php echo $this->ID ?>">
|
66 |
+
<?php wp_nonce_field('capsman-general-manager'); ?>
|
67 |
+
<fieldset>
|
68 |
+
<table id="akmin">
|
69 |
+
<tr>
|
70 |
+
<td class="content">
|
71 |
+
<dl>
|
72 |
+
<dt>
|
73 |
+
<?php
|
74 |
+
$role_caption = (defined('PUBLISHPRESS_VERSION'))
|
75 |
+
? '<a href="' . admin_url("admin.php?page=pp-manage-roles&action=edit-role&role-id={$this->current}") . '">' . translate_user_role($roles[$default]) . '</a>'
|
76 |
+
: translate_user_role($roles[$default]);
|
77 |
+
|
78 |
+
printf(__('Capabilities for %s', 'capsman-enhanced'), $role_caption);
|
79 |
+
?>
|
80 |
+
</dt>
|
81 |
+
|
82 |
+
<dd>
|
83 |
+
<div style="float:right">
|
84 |
+
<input type="submit" name="SaveRole" value="<?php _e('Save Changes', 'capsman-enhanced') ?>" class="button-primary" />
|
85 |
+
</div>
|
86 |
+
|
87 |
+
<?php
|
88 |
+
global $capsman;
|
89 |
+
$img_url = $capsman->mod_url . '/images/';
|
90 |
+
?>
|
91 |
+
<div class="publishpress-headline">
|
92 |
+
<span class="cme-subtext">
|
93 |
+
<?php
|
94 |
+
$msg = __( '<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation.', 'capsman-enhanced' );
|
95 |
+
|
96 |
+
if (defined('PRESSPERMIT_ACTIVE') && function_exists('presspermit')) {
|
97 |
+
if ($group = presspermit()->groups()->getMetagroup('wp_role', $this->current)) {
|
98 |
+
$msg = sprintf(
|
99 |
+
__('<strong>Note:</strong> Capability changes <strong>remain in the database</strong> after plugin deactivation. You can also configure this role as a %sPermission Group%s.', 'capsman-enhanced'),
|
100 |
+
'<a href="' . admin_url("admin.php?page=presspermit-edit-permissions&action=edit&agent_id={$group->ID}") . '">',
|
101 |
+
'</a>'
|
102 |
+
);
|
103 |
+
}
|
104 |
+
}
|
105 |
+
echo $msg;
|
106 |
+
?>
|
107 |
+
</span>
|
108 |
+
</div>
|
109 |
+
|
110 |
+
<?php
|
111 |
+
if ( defined( 'PRESSPERMIT_ACTIVE' ) ) {
|
112 |
+
$pp_ui->show_capability_hints( $default );
|
113 |
+
}
|
114 |
+
?>
|
115 |
+
|
116 |
+
<script type="text/javascript">
|
117 |
+
/* <![CDATA[ */
|
118 |
+
jQuery(document).ready( function($) {
|
119 |
+
$('a[href="#pp-more"]').click( function() {
|
120 |
+
$('#pp_features').show();
|
121 |
+
return false;
|
122 |
+
});
|
123 |
+
$('a[href="#pp-hide"]').click( function() {
|
124 |
+
$('#pp_features').hide();
|
125 |
+
return false;
|
126 |
+
});
|
127 |
+
});
|
128 |
+
/* ]]> */
|
129 |
+
</script>
|
130 |
+
|
131 |
+
<?php /* play.png icon by Pavel: http://kde-look.org/usermanager/search.php?username=InFeRnODeMoN */ ?>
|
132 |
+
|
133 |
+
<br /><div id="pp_features" style="display:none"><div class="pp-logo"><a href="https://publishpress.com/presspermit/"><img src="<?php echo $img_url;?>pp-logo.png" alt="<?php _e('PublishPress Permissions', 'capsman-enhanced');?>" /></a></div><div class="features-wrap"><ul class="pp-features">
|
134 |
+
<li>
|
135 |
+
<?php _e( "Automatically define type-specific capabilities for your custom post types and taxonomies", 'capsman-enhanced' );?>
|
136 |
+
<a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
137 |
+
|
138 |
+
<li>
|
139 |
+
<?php _e( "Assign standard WP roles supplementally for a specific post type", 'capsman-enhanced' );?>
|
140 |
+
<a href="https://presspermit.com/tutorial/regulate-post-type-access" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
141 |
+
|
142 |
+
<li>
|
143 |
+
<?php _e( "Assign custom WP roles supplementally for a specific post type <em>(Pro)</em>", 'capsman-enhanced' );?>
|
144 |
+
</li>
|
145 |
+
|
146 |
+
<li>
|
147 |
+
<?php _e( "Customize reading permissions per-category or per-post", 'capsman-enhanced' );?>
|
148 |
+
<a href="https://presspermit.com/tutorial/category-exceptions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
149 |
+
|
150 |
+
<li>
|
151 |
+
<?php _e( "Customize editing permissions per-category or per-post <em>(Pro)</em>", 'capsman-enhanced' );?>
|
152 |
+
<a href="https://presspermit.com/tutorial/page-editing-exceptions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
153 |
+
|
154 |
+
<li>
|
155 |
+
<?php _e( "Custom Post Visibility statuses, fully implemented throughout wp-admin <em>(Pro)</em>", 'capsman-enhanced' );?>
|
156 |
+
<a href="https://presspermit.com/tutorial/custom-post-visibility" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
157 |
+
|
158 |
+
<li>
|
159 |
+
<?php _e( "Custom Moderation statuses for access-controlled, multi-step publishing workflow <em>(Pro)</em>", 'capsman-enhanced' );?>
|
160 |
+
<a href="https://presspermit.com/tutorial/multi-step-moderation" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
161 |
+
|
162 |
+
<li>
|
163 |
+
<?php _e( "Regulate permissions for Edit Flow post statuses <em>(Pro)</em>", 'capsman-enhanced' );?>
|
164 |
+
<a href="https://presspermit.com/tutorial/edit-flow-integration" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
165 |
+
|
166 |
+
<li>
|
167 |
+
<?php _e( "Customize the moderated editing of published content with Revisionary or Post Forking <em>(Pro)</em>", 'capsman-enhanced' );?>
|
168 |
+
<a href="https://presspermit.com/tutorial/published-content-revision" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
169 |
+
|
170 |
+
<li>
|
171 |
+
<?php _e( "Grant Spectator, Participant or Moderator access to specific bbPress forums <em>(Pro)</em>", 'capsman-enhanced' );?>
|
172 |
+
</li>
|
173 |
+
|
174 |
+
<li>
|
175 |
+
<?php _e( "Grant supplemental content permissions to a BuddyPress group <em>(Pro)</em>", 'capsman-enhanced' );?>
|
176 |
+
<a href="https://presspermit.com/tutorial/buddypress-content-permissions" target="_blank"><img class="cme-play" alt="*" src="<?php echo $img_url;?>play.png" /></a></li>
|
177 |
+
|
178 |
+
<li>
|
179 |
+
<?php _e( "WPML integration to mirror permissions to translations <em>(Pro)</em>", 'capsman-enhanced' );?>
|
180 |
+
</li>
|
181 |
+
|
182 |
+
<li>
|
183 |
+
<?php _e( "Member support forum", 'capsman-enhanced' );?>
|
184 |
+
</li>
|
185 |
+
|
186 |
+
</ul></div>
|
187 |
+
|
188 |
+
<?php
|
189 |
+
echo '<div>';
|
190 |
+
printf( __('%1$sgrab%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<span class="plugins update-message"><a href="' . cme_plugin_info_url('press-permit-core') . '" class="thickbox" title="' . sprintf( __('%s (free install)', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions Pro</a></span>' );
|
191 |
+
echo ' • ';
|
192 |
+
printf( __('%1$sbuy%2$s %3$s', 'capsman-enhanced'), '<strong>', '</strong>', '<a href="https://publishpress.com/presspermit/" target="_blank" title="' . sprintf( __('%s info/purchase', 'capsman-enhanced'), 'Permissions Pro' ) . '">Permissions Pro</a>' );
|
193 |
+
echo ' • ';
|
194 |
+
echo '<a href="#pp-hide">hide</a>';
|
195 |
+
echo '</div></div>';
|
196 |
+
|
197 |
+
if ( MULTISITE ) {
|
198 |
+
global $wp_roles;
|
199 |
+
global $wpdb;
|
200 |
+
|
201 |
+
if ( ! empty($_REQUEST['cme_net_sync_role'] ) ) {
|
202 |
+
switch_to_blog(1);
|
203 |
+
wp_cache_delete( $wpdb->prefix . 'user_roles', 'options' );
|
204 |
+
}
|
205 |
+
|
206 |
+
( method_exists( $wp_roles, 'for_site' ) ) ? $wp_roles->for_site() : $wp_roles->reinit();
|
207 |
+
}
|
208 |
+
$capsman->reinstate_db_roles();
|
209 |
+
|
210 |
+
$current = get_role($default);
|
211 |
+
|
212 |
+
$rcaps = $current->capabilities;
|
213 |
+
|
214 |
+
$is_administrator = current_user_can( 'administrator' ) || (is_multisite() && is_super_admin());
|
215 |
+
|
216 |
+
$custom_types = get_post_types( array( '_builtin' => false ), 'names' );
|
217 |
+
$custom_tax = get_taxonomies( array( '_builtin' => false ), 'names' );
|
218 |
+
|
219 |
+
$defined = array();
|
220 |
+
$defined['type'] = get_post_types( array( 'public' => true, 'show_ui' => true ), 'object', 'or' );
|
221 |
+
$defined['taxonomy'] = get_taxonomies( array( 'public' => true ), 'object' );
|
222 |
+
|
223 |
+
$unfiltered['type'] = apply_filters( 'pp_unfiltered_post_types', array( 'forum','topic','reply','wp_block' ) ); // bbPress' dynamic role def requires additional code to enforce stored caps
|
224 |
+
$unfiltered['taxonomy'] = apply_filters( 'pp_unfiltered_taxonomies', array( 'post_status', 'topic-tag' ) ); // avoid confusion with Edit Flow administrative taxonomy
|
225 |
+
|
226 |
+
$enabled_taxonomies = cme_get_assisted_taxonomies();
|
227 |
+
|
228 |
+
/*
|
229 |
+
if ( ( count($custom_types) || count($custom_tax) ) && ( $is_administrator || current_user_can( 'manage_pp_settings' ) ) ) {
|
230 |
+
$cap_properties[''] = array();
|
231 |
+
$force_distinct_ui = true;
|
232 |
+
}
|
233 |
+
*/
|
234 |
+
|
235 |
+
$cap_properties['edit']['type'] = array( 'edit_posts' );
|
236 |
+
|
237 |
+
foreach( $defined['type'] as $type_obj ) {
|
238 |
+
if ( 'attachment' != $type_obj->name ) {
|
239 |
+
if ( isset( $type_obj->cap->create_posts ) && ( $type_obj->cap->create_posts != $type_obj->cap->edit_posts ) ) {
|
240 |
+
$cap_properties['edit']['type'][]= 'create_posts';
|
241 |
+
break;
|
242 |
+
}
|
243 |
+
}
|
244 |
+
}
|
245 |
+
|
246 |
+
$cap_properties['edit']['type'][]= 'edit_others_posts';
|
247 |
+
$cap_properties['edit']['type'] = array_merge( $cap_properties['edit']['type'], array( 'publish_posts', 'edit_published_posts', 'edit_private_posts' ) );
|
248 |
+
|
249 |
+
$cap_properties['edit']['taxonomy'] = array( 'manage_terms' );
|
250 |
+
|
251 |
+
if ( ! defined( 'OLD_PRESSPERMIT_ACTIVE' ) )
|
252 |
+
$cap_properties['edit']['taxonomy'] = array_merge( $cap_properties['edit']['taxonomy'], array( 'edit_terms', 'assign_terms' ) );
|
253 |
+
|
254 |
+
$cap_properties['delete']['type'] = array( 'delete_posts', 'delete_others_posts' );
|
255 |
+
$cap_properties['delete']['type'] = array_merge( $cap_properties['delete']['type'], array( 'delete_published_posts', 'delete_private_posts' ) );
|
256 |
+
|
257 |
+
if ( ! defined( 'OLD_PRESSPERMIT_ACTIVE' ) )
|
258 |
+
$cap_properties['delete']['taxonomy'] = array( 'delete_terms' );
|
259 |
+
else
|
260 |
+
$cap_properties['delete']['taxonomy'] = array();
|
261 |
+
|
262 |
+
$cap_properties['read']['type'] = array( 'read_private_posts' );
|
263 |
+
$cap_properties['read']['taxonomy'] = array();
|
264 |
+
|
265 |
+
$stati = get_post_stati( array( 'internal' => false ) );
|
266 |
+
|
267 |
+
$cap_type_names = array(
|
268 |
+
'' => __( ' ', 'capsman-enhanced' ),
|
269 |
+
'read' => __( 'Reading', 'capsman-enhanced' ),
|
270 |
+
'edit' => __( 'Editing Capabilities', 'capsman-enhanced' ),
|
271 |
+
'delete' => __( 'Deletion Capabilities', 'capsman-enhanced' )
|
272 |
+
);
|
273 |
+
|
274 |
+
$cap_tips = array(
|
275 |
+
'read_private' => __( 'can read posts which are currently published with private visibility', 'capsman-enhanced' ),
|
276 |
+
'edit' => __( 'has basic editing capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
|
277 |
+
'edit_others' => __( 'can edit posts which were created by other users', 'capsman-enhanced' ),
|
278 |
+
'edit_published' => __( 'can edit posts which are currently published', 'capsman-enhanced' ),
|
279 |
+
'edit_private' => __( 'can edit posts which are currently published with private visibility', 'capsman-enhanced' ),
|
280 |
+
'publish' => __( 'can make a post publicly visible', 'capsman-enhanced' ),
|
281 |
+
'delete' => __( 'has basic deletion capability (but may need other capabilities based on post status and ownership)', 'capsman-enhanced' ),
|
282 |
+
'delete_others' => __( 'can delete posts which were created by other users', 'capsman-enhanced' ),
|
283 |
+
'delete_published' => __( 'can delete posts which are currently published', 'capsman-enhanced' ),
|
284 |
+
'delete_private' => __( 'can delete posts which are currently published with private visibility', 'capsman-enhanced' ),
|
285 |
+
);
|
286 |
+
|
287 |
+
$default_caps = array( 'read_private_posts', 'edit_posts', 'edit_others_posts', 'edit_published_posts', 'edit_private_posts', 'publish_posts', 'delete_posts', 'delete_others_posts', 'delete_published_posts', 'delete_private_posts',
|
288 |
+
'read_private_pages', 'edit_pages', 'edit_others_pages', 'edit_published_pages', 'edit_private_pages', 'publish_pages', 'delete_pages', 'delete_others_pages', 'delete_published_pages', 'delete_private_pages',
|
289 |
+
'manage_categories'
|
290 |
+
);
|
291 |
+
$type_caps = array();
|
292 |
+
$type_metacaps = array();
|
293 |
+
|
294 |
+
// Role Scoper and PP1 adjust attachment access based only on user's capabilities for the parent post
|
295 |
+
if ( defined('OLD_PRESSPERMIT_ACTIVE') ) {
|
296 |
+
unset( $defined['type']['attachment'] );
|
297 |
+
}
|
298 |
+
|
299 |
+
echo '<ul class="cme-listhoriz">';
|
300 |
+
|
301 |
+
// cap_types: read, edit, deletion
|
302 |
+
foreach( array_keys($cap_properties) as $cap_type ) {
|
303 |
+
echo '<li>';
|
304 |
+
echo '<h3>' . $cap_type_names[$cap_type] . '</h3>';
|
305 |
+
|
306 |
+
echo "<div class='cme-cap-type-tables cme-cap-type-tables-$cap_type'>";
|
307 |
+
|
308 |
+
foreach( array_keys($defined) as $item_type ) {
|
309 |
+
if ( ( 'delete' == $cap_type ) && ( 'taxonomy' == $item_type ) ) {
|
310 |
+
if ( defined('OLD_PRESSPERMIT_ACTIVE') ) {
|
311 |
+
continue;
|
312 |
+
}
|
313 |
+
|
314 |
+
$any_term_deletion_caps = false;
|
315 |
+
foreach( array_keys($defined['taxonomy']) as $_tax ) {
|
316 |
+
if ( isset( $defined['taxonomy'][$_tax]->cap->delete_terms ) && ( 'manage_categories' != $defined['taxonomy'][$_tax]->cap->delete_terms ) && ! in_array( $_tax, $unfiltered['taxonomy'] ) ) {
|
317 |
+
$any_term_deletion_caps = true;
|
318 |
+
break;
|
319 |
+
}
|
320 |
+
}
|
321 |
+
|
322 |
+
if ( ! $any_term_deletion_caps )
|
323 |
+
continue;
|
324 |
+
}
|
325 |
+
|
326 |
+
if ( ! count( $cap_properties[$cap_type][$item_type] ) )
|
327 |
+
continue;
|
328 |
+
|
329 |
+
echo "<table class='cme-typecaps cme-typecaps-$cap_type'>";
|
330 |
+
|
331 |
+
echo '<tr><th></th>';
|
332 |
+
|
333 |
+
// label cap properties
|
334 |
+
foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
|
335 |
+
$prop = str_replace( '_posts', '', $prop );
|
336 |
+
$prop = str_replace( '_pages', '', $prop );
|
337 |
+
$prop = str_replace( '_terms', '', $prop );
|
338 |
+
$tip = ( isset( $cap_tips[$prop] ) ) ? "title='{$cap_tips[$prop]}'" : '';
|
339 |
+
$prop = str_replace( '_', '<br />', $prop );
|
340 |
+
$th_class = ( 'taxonomy' == $item_type ) ? ' class="term-cap"' : ' class="post-cap"';
|
341 |
+
echo "<th $tip{$th_class}>";
|
342 |
+
|
343 |
+
if ( ( 'delete' != $prop ) || ( 'taxonomy' != $item_type ) || cme_get_detailed_taxonomies() ) {
|
344 |
+
echo ucwords($prop);
|
345 |
+
}
|
346 |
+
|
347 |
+
echo '</th>';
|
348 |
+
}
|
349 |
+
|
350 |
+
echo '</tr>';
|
351 |
+
|
352 |
+
foreach( $defined[$item_type] as $key => $type_obj ) {
|
353 |
+
if ( in_array( $key, $unfiltered[$item_type] ) )
|
354 |
+
continue;
|
355 |
+
|
356 |
+
$row = "<tr class='cme_type_{$key}'>";
|
357 |
+
|
358 |
+
if ( $cap_type ) {
|
359 |
+
if ( empty($force_distinct_ui) && empty( $cap_properties[$cap_type][$item_type] ) )
|
360 |
+
continue;
|
361 |
+
|
362 |
+
$row .= "<td><a class='cap_type' href='#toggle_type_caps'>" . $type_obj->labels->name . '</a>';
|
363 |
+
$row .= '<a href="#" class="neg-type-caps"> x </a>';
|
364 |
+
$row .= '</td>';
|
365 |
+
|
366 |
+
$display_row = ! empty($force_distinct_ui);
|
367 |
+
|
368 |
+
foreach( $cap_properties[$cap_type][$item_type] as $prop ) {
|
369 |
+
$td_classes = array();
|
370 |
+
$checkbox = '';
|
371 |
+
$title = '';
|
372 |
+
|
373 |
+
if ( ! empty($type_obj->cap->$prop) && ( in_array( $type_obj->name, array( 'post', 'page' ) )
|
374 |
+
|| ! in_array( $type_obj->cap->$prop, $default_caps )
|
375 |
+
|| ( ( 'manage_categories' == $type_obj->cap->$prop ) && ( 'manage_terms' == $prop ) && ( 'category' == $type_obj->name ) ) ) ) {
|
376 |
+
|
377 |
+
// if edit_published or edit_private cap is same as edit_posts cap, don't display a checkbox for it
|
378 |
+
if ( ( ! in_array( $prop, array( 'edit_published_posts', 'edit_private_posts', 'create_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->edit_posts ) )
|
379 |
+
&& ( ! in_array( $prop, array( 'delete_published_posts', 'delete_private_posts' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->delete_posts ) )
|
380 |
+
&& ( ! in_array( $prop, array( 'edit_terms', 'delete_terms' ) ) || ( $type_obj->cap->$prop != $type_obj->cap->manage_terms ) )
|
381 |
+
|
382 |
+
&& ( ! in_array( $prop, array( 'manage_terms', 'edit_terms', 'delete_terms', 'assign_terms' ) )
|
383 |
+
|| empty($cme_cap_helper->all_taxonomy_caps[$type_obj->cap->$prop])
|
384 |
+
|| ( $cme_cap_helper->all_taxonomy_caps[ $type_obj->cap->$prop ] <= 1 )
|
385 |
+
|| $type_obj->cap->$prop == str_replace( '_terms', "_{$type_obj->name}s", $prop )
|
386 |
+
|| $type_obj->cap->$prop == str_replace( '_terms', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
|
387 |
+
)
|
388 |
+
|
389 |
+
&& ( in_array( $prop, array( 'manage_terms', 'edit_terms', 'delete_terms', 'assign_terms' ) )
|
390 |
+
|| empty($cme_cap_helper->all_type_caps[$type_obj->cap->$prop])
|
391 |
+
|| ( $cme_cap_helper->all_type_caps[ $type_obj->cap->$prop ] <= 1 )
|
392 |
+
|| $type_obj->cap->$prop == 'upload_files' && 'create_posts' == $prop && 'attachment' == $type_obj->name
|
393 |
+
|| $type_obj->cap->$prop == str_replace( '_posts', "_{$type_obj->name}s", $prop )
|
394 |
+
|| $type_obj->cap->$prop == str_replace( '_pages', "_{$type_obj->name}s", $prop )
|
395 |
+
|| $type_obj->cap->$prop == str_replace( '_posts', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
|
396 |
+
|| $type_obj->cap->$prop == str_replace( '_pages', "_" . _cme_get_plural($type_obj->name, $type_obj), $prop )
|
397 |
+
)
|
398 |
+
) {
|
399 |
+
// only present these term caps up top if we are ensuring that they get enforced separately from manage_terms
|
400 |
+
if ( in_array( $prop, array( 'edit_terms', 'delete_terms', 'assign_terms' ) ) && ( ! in_array( $type_obj->name, cme_get_detailed_taxonomies() ) || defined( 'OLD_PRESSPERMIT_ACTIVE' ) ) ) {
|
401 |
+
continue;
|
402 |
+
}
|
403 |
+
|
404 |
+
$cap_name = $type_obj->cap->$prop;
|
405 |
+
|
406 |
+
if ( 'taxonomy' == $item_type )
|
407 |
+
$td_classes []= "term-cap";
|
408 |
+
else
|
409 |
+
$td_classes []= "post-cap";
|
410 |
+
|
411 |
+
if ( ! empty($pp_metagroup_caps[$cap_name]) )
|
412 |
+
$td_classes []='cm-has-via-pp';
|
413 |
+
|
414 |
+
if ( $is_administrator || current_user_can($cap_name) ) {
|
415 |
+
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
416 |
+
$title = ' title="' . sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name ) . '"';
|
417 |
+
} else {
|
418 |
+
$title = ' title="' . $cap_name . '"';
|
419 |
+
}
|
420 |
+
|
421 |
+
$disabled = '';
|
422 |
+
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
423 |
+
|
424 |
+
$checkbox = '<input type="checkbox"' . $title . ' name="caps[' . $cap_name . ']" value="1" ' . $checked . $disabled . ' />';
|
425 |
+
|
426 |
+
$type_caps [$cap_name] = true;
|
427 |
+
$display_row = true;
|
428 |
+
}
|
429 |
+
} else {
|
430 |
+
//$td_classes []= "cap-unreg";
|
431 |
+
$title = 'title="' . sprintf( __( 'shared capability: %s', 'capsman-enhanced' ), esc_attr( $type_obj->cap->$prop ) ) . '"';
|
432 |
+
}
|
433 |
+
|
434 |
+
if ( isset($rcaps[$cap_name]) && empty($rcaps[$cap_name]) ) {
|
435 |
+
$td_classes []= "cap-neg";
|
436 |
+
}
|
437 |
+
} else {
|
438 |
+
$td_classes []= "cap-unreg";
|
439 |
+
}
|
440 |
+
|
441 |
+
$td_class = ( $td_classes ) ? 'class="' . implode(' ', $td_classes) . '"' : '';
|
442 |
+
|
443 |
+
$row .= "<td $td_class $title><span class='cap-x'>X</span>$checkbox";
|
444 |
+
|
445 |
+
if ( false !== strpos( $td_class, 'cap-neg' ) )
|
446 |
+
$row .= '<input type="hidden" class="cme-negation-input" name="caps[' . $cap_name . ']" value="" />';
|
447 |
+
|
448 |
+
$row .= "</td>";
|
449 |
+
}
|
450 |
+
|
451 |
+
if ('type' == $item_type) {
|
452 |
+
$type_metacaps[$type_obj->cap->read_post] = true;
|
453 |
+
$type_metacaps[$type_obj->cap->edit_post] = isset($type_obj->cap->edit_posts) && ($type_obj->cap->edit_post != $type_obj->cap->edit_posts);
|
454 |
+
$type_metacaps[$type_obj->cap->delete_post] = isset($type_obj->cap->delete_posts) && ($type_obj->cap->delete_post != $type_obj->cap->delete_posts);
|
455 |
+
|
456 |
+
} elseif ('taxonomy' == $item_type && !empty($type_obj->cap->edit_term) && !empty($type_obj->cap->delete_term)) {
|
457 |
+
$type_metacaps[$type_obj->cap->edit_term] = true;
|
458 |
+
$type_metacaps[$type_obj->cap->delete_term] = true;
|
459 |
+
}
|
460 |
+
}
|
461 |
+
|
462 |
+
if ( $display_row ) {
|
463 |
+
$row .= '</tr>';
|
464 |
+
echo $row;
|
465 |
+
}
|
466 |
+
}
|
467 |
+
|
468 |
+
echo '</table>';
|
469 |
+
|
470 |
+
} // end foreach item type
|
471 |
+
|
472 |
+
echo '</div>';
|
473 |
+
|
474 |
+
echo '</li>';
|
475 |
+
}
|
476 |
+
|
477 |
+
|
478 |
+
do_action('publishpress-caps_manager_postcaps_section', compact('current', 'rcaps', 'pp_metagroup_caps', 'is_administrator', 'default_caps', 'custom_types', 'defined', 'unfiltered', 'pp_metagroup_caps'));
|
479 |
+
|
480 |
+
$type_caps = apply_filters('publishpress_caps_manager_typecaps', $type_caps);
|
481 |
+
|
482 |
+
echo '</ul>';
|
483 |
+
|
484 |
+
// clicking on post type name toggles corresponding checkbox selections
|
485 |
+
?>
|
486 |
+
<script type="text/javascript">
|
487 |
+
/* <![CDATA[ */
|
488 |
+
jQuery(document).ready( function($) {
|
489 |
+
$('a[href="#toggle_type_caps"]').click( function() {
|
490 |
+
var chks = $(this).closest('tr').find('input');
|
491 |
+
$(chks).prop( 'checked', ! $(chks).first().is(':checked') );
|
492 |
+
return false;
|
493 |
+
});
|
494 |
+
});
|
495 |
+
/* ]]> */
|
496 |
+
</script>
|
497 |
+
<?php
|
498 |
+
|
499 |
+
echo '<p> </p><h3>' . __( 'Other WordPress Core Capabilities', 'capsman-enhanced' ) . '</h3>';
|
500 |
+
echo '<table class="form-table cme-checklist"><tr>';
|
501 |
+
|
502 |
+
$checks_per_row = get_option( 'cme_form-rows', 5 );
|
503 |
+
$i = 0; $first_row = true;
|
504 |
+
|
505 |
+
$core_caps = _cme_core_caps();
|
506 |
+
foreach( array_keys($core_caps) as $cap_name ) {
|
507 |
+
if ( ! $is_administrator && ! current_user_can($cap_name) )
|
508 |
+
continue;
|
509 |
+
|
510 |
+
if ( $i == $checks_per_row ) {
|
511 |
+
echo '</tr><tr>';
|
512 |
+
$i = 0;
|
513 |
+
}
|
514 |
+
|
515 |
+
if ( ! isset( $rcaps[$cap_name] ) )
|
516 |
+
$class = 'cap-no';
|
517 |
+
else
|
518 |
+
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
|
519 |
+
|
520 |
+
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
521 |
+
$class .= ' cap-metagroup';
|
522 |
+
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
|
523 |
+
} else {
|
524 |
+
$title_text = $cap_name;
|
525 |
+
}
|
526 |
+
|
527 |
+
$disabled = '';
|
528 |
+
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
529 |
+
$lock_capability = false;
|
530 |
+
$title = $title_text;
|
531 |
+
|
532 |
+
if ( 'read' == $cap_name ) {
|
533 |
+
if ( ! empty( $block_read_removal ) ) {
|
534 |
+
// prevent the read capability from being removed from a core role, but don't force it to be added
|
535 |
+
if ( $checked || apply_filters( 'pp_caps_force_capability_storage', false, 'read', $default ) ) {
|
536 |
+
if ( apply_filters( 'pp_caps_lock_capability', true, 'read', $default ) ) {
|
537 |
+
$lock_capability = true;
|
538 |
+
$class .= ' cap-locked';
|
539 |
+
$disabled = 'disabled="disabled"';
|
540 |
+
if ( 'administrator' != $this->current ) {
|
541 |
+
$title = esc_attr( __('Lockout Prevention: To remove read capability, first remove WordPress admin / editing capabilities, or add "dashboard_lockout_ok" capability', 'capsman-enhanced' ) );
|
542 |
+
}
|
543 |
+
}
|
544 |
+
}
|
545 |
+
}
|
546 |
+
}
|
547 |
+
|
548 |
+
?>
|
549 |
+
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
|
550 |
+
<span>
|
551 |
+
<?php
|
552 |
+
echo str_replace( '_', ' ', $cap_name );
|
553 |
+
?>
|
554 |
+
</span></label><a href="#" class="neg-cap"> x </a>
|
555 |
+
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
|
556 |
+
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
|
557 |
+
<?php endif; ?>
|
558 |
+
</td>
|
559 |
+
|
560 |
+
<?php
|
561 |
+
|
562 |
+
if ( $lock_capability ) {
|
563 |
+
echo '<input type="hidden" name="caps[' . $cap_name . ']" value="1" />';
|
564 |
+
}
|
565 |
+
|
566 |
+
++$i;
|
567 |
+
}
|
568 |
+
|
569 |
+
if ( $i == $checks_per_row ) {
|
570 |
+
echo '</tr>';
|
571 |
+
$i = 0;
|
572 |
+
} elseif ( ! $first_row ) {
|
573 |
+
// Now close a wellformed table
|
574 |
+
for ( $i; $i < $checks_per_row; $i++ ){
|
575 |
+
echo '<td> </td>';
|
576 |
+
}
|
577 |
+
echo '</tr>';
|
578 |
+
}
|
579 |
+
?>
|
580 |
+
|
581 |
+
<tr class="cme-bulk-select">
|
582 |
+
<td colspan="<?php echo $checks_per_row;?>">
|
583 |
+
<span style="float:right">
|
584 |
+
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>"> <a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
|
585 |
+
</span>
|
586 |
+
</td></tr>
|
587 |
+
|
588 |
+
</table>
|
589 |
+
<?php
|
590 |
+
$all_capabilities = apply_filters( 'capsman_get_capabilities', array_keys( $this->capabilities ), $this->ID );
|
591 |
+
$all_capabilities = apply_filters( 'members_get_capabilities', $all_capabilities );
|
592 |
+
|
593 |
+
/*
|
594 |
+
$publishpress_status_change_caps = array();
|
595 |
+
foreach( $all_capabilities as $cap_name ) {
|
596 |
+
if (0 === strpos($cap_name, 'status_change_')) {
|
597 |
+
$publishpress_status_change_caps []= $cap_name;
|
598 |
+
}
|
599 |
+
}
|
600 |
+
*/
|
601 |
+
|
602 |
+
$plugin_caps = [];
|
603 |
+
|
604 |
+
if (defined('PUBLISHPRESS_VERSION')) {
|
605 |
+
$plugin_caps['PublishPress'] = apply_filters('cme_publishpress_capabilities',
|
606 |
+
array(
|
607 |
+
'edit_metadata',
|
608 |
+
'edit_post_subscriptions',
|
609 |
+
'ppma_edit_orphan_post',
|
610 |
+
'pp_manage_roles',
|
611 |
+
'pp_set_notification_channel',
|
612 |
+
'pp_view_calendar',
|
613 |
+
'pp_view_content_overview',
|
614 |
+
'status_change',
|
615 |
+
)
|
616 |
+
);
|
617 |
+
}
|
618 |
+
|
619 |
+
if (defined('PUBLISHPRESS_MULTIPLE_AUTHORS_VERSION')) {
|
620 |
+
if ($_caps = apply_filters('cme_multiple_authors_capabilities', array())) {
|
621 |
+
$plugin_caps['PublishPress Authors'] = $_caps;
|
622 |
+
}
|
623 |
+
}
|
624 |
+
|
625 |
+
if (defined('PRESSPERMIT_VERSION')) {
|
626 |
+
$plugin_caps['PublishPress Permissions'] = apply_filters('cme_presspermit_capabilities',
|
627 |
+
array(
|
628 |
+
'edit_own_attachments',
|
629 |
+
'list_others_unattached_files',
|
630 |
+
'pp_administer_content',
|
631 |
+
'pp_assign_roles',
|
632 |
+
'pp_associate_any_page',
|
633 |
+
'pp_create_groups',
|
634 |
+
'pp_create_network_groups',
|
635 |
+
'pp_define_moderation',
|
636 |
+
'pp_define_post_status',
|
637 |
+
'pp_define_privacy',
|
638 |
+
'pp_delete_groups',
|
639 |
+
'pp_edit_groups',
|
640 |
+
'pp_exempt_edit_circle',
|
641 |
+
'pp_exempt_read_circle',
|
642 |
+
'pp_force_quick_edit',
|
643 |
+
'pp_list_all_files',
|
644 |
+
'pp_manage_capabilities',
|
645 |
+
'pp_manage_members',
|
646 |
+
'pp_manage_network_members',
|
647 |
+
'pp_manage_settings',
|
648 |
+
'pp_moderate_any',
|
649 |
+
'pp_set_associate_exceptions',
|
650 |
+
'pp_set_edit_exceptions',
|
651 |
+
'pp_set_read_exceptions',
|
652 |
+
'pp_set_revise_exceptions',
|
653 |
+
'pp_set_term_assign_exceptions',
|
654 |
+
'pp_set_term_associate_exceptions',
|
655 |
+
'pp_set_term_manage_exceptions',
|
656 |
+
'pp_unfiltered',
|
657 |
+
'set_posts_status',
|
658 |
+
)
|
659 |
+
);
|
660 |
+
}
|
661 |
+
|
662 |
+
if (defined('WC_PLUGIN_FILE')) {
|
663 |
+
$plugin_caps['WooCommerce'] = apply_filters('cme_woocommerce_capabilities',
|
664 |
+
array(
|
665 |
+
'assign_product_terms',
|
666 |
+
'assign_shop_coupon_terms',
|
667 |
+
'assign_shop_discount_terms',
|
668 |
+
'assign_shop_order_terms',
|
669 |
+
'assign_shop_payment_terms',
|
670 |
+
'create_shop_orders',
|
671 |
+
'delete_others_products',
|
672 |
+
'delete_others_shop_coupons',
|
673 |
+
'delete_others_shop_discounts',
|
674 |
+
'delete_others_shop_orders',
|
675 |
+
'delete_others_shop_payments',
|
676 |
+
'delete_private_products',
|
677 |
+
'delete_private_shop_coupons',
|
678 |
+
'delete_private_shop_orders',
|
679 |
+
'delete_private_shop_discounts',
|
680 |
+
'delete_private_shop_payments',
|
681 |
+
'delete_product_terms',
|
682 |
+
'delete_products',
|
683 |
+
'delete_published_products',
|
684 |
+
'delete_published_shop_coupons',
|
685 |
+
'delete_published_shop_discounts',
|
686 |
+
'delete_published_shop_orders',
|
687 |
+
'delete_published_shop_payments',
|
688 |
+
'delete_shop_coupons',
|
689 |
+
'delete_shop_coupon_terms',
|
690 |
+
'delete_shop_discount_terms',
|
691 |
+
'delete_shop_discounts',
|
692 |
+
'delete_shop_order_terms',
|
693 |
+
'delete_shop_orders',
|
694 |
+
'delete_shop_payments',
|
695 |
+
'delete_shop_payment_terms',
|
696 |
+
'edit_others_products',
|
697 |
+
'edit_others_shop_coupons',
|
698 |
+
'edit_others_shop_discounts',
|
699 |
+
'edit_others_shop_orders',
|
700 |
+
'edit_others_shop_payments',
|
701 |
+
'edit_private_products',
|
702 |
+
'edit_private_shop_coupons',
|
703 |
+
'edit_private_shop_discounts',
|
704 |
+
'edit_private_shop_orders',
|
705 |
+
'edit_private_shop_payments',
|
706 |
+
'edit_product_terms',
|
707 |
+
'edit_products',
|
708 |
+
'edit_published_products',
|
709 |
+
'edit_published_shop_coupons',
|
710 |
+
'edit_published_shop_discounts',
|
711 |
+
'edit_published_shop_orders',
|
712 |
+
'edit_published_shop_payments',
|
713 |
+
'edit_shop_coupon_terms',
|
714 |
+
'edit_shop_coupons',
|
715 |
+
'edit_shop_discounts',
|
716 |
+
'edit_shop_discount_terms',
|
717 |
+
'edit_shop_order_terms',
|
718 |
+
'edit_shop_orders',
|
719 |
+
'edit_shop_payments',
|
720 |
+
'edit_shop_payment_terms',
|
721 |
+
'export_shop_payments',
|
722 |
+
'export_shop_reports',
|
723 |
+
'import_shop_discounts',
|
724 |
+
'import_shop_payments',
|
725 |
+
'manage_product_terms',
|
726 |
+
'manage_shop_coupon_terms',
|
727 |
+
'manage_shop_discounts',
|
728 |
+
'manage_shop_discount_terms',
|
729 |
+
'manage_shop_payment_terms',
|
730 |
+
'manage_shop_order_terms',
|
731 |
+
'manage_shop_settings',
|
732 |
+
'manage_woocommerce',
|
733 |
+
'publish_products',
|
734 |
+
'publish_shop_coupons',
|
735 |
+
'publish_shop_discounts',
|
736 |
+
'publish_shop_orders',
|
737 |
+
'publish_shop_payments',
|
738 |
+
'read_private_products',
|
739 |
+
'read_private_shop_coupons',
|
740 |
+
'read_private_shop_discounts',
|
741 |
+
'read_private_shop_payments',
|
742 |
+
'read_private_shop_orders',
|
743 |
+
'view_admin_dashboard',
|
744 |
+
'view_shop_discount_stats',
|
745 |
+
'view_shop_payment_stats',
|
746 |
+
'view_shop_reports',
|
747 |
+
'view_shop_sensitive_data',
|
748 |
+
'view_woocommerce_reports',
|
749 |
+
)
|
750 |
+
);
|
751 |
+
}
|
752 |
+
|
753 |
+
$plugin_caps = apply_filters('cme_plugin_capabilities', $plugin_caps);
|
754 |
+
|
755 |
+
foreach($plugin_caps as $plugin => $__plugin_caps) {
|
756 |
+
$_plugin_caps = array_fill_keys($__plugin_caps, true);
|
757 |
+
|
758 |
+
echo '<h3 class="cme-cap-section">' . sprintf(__( '%s Capabilities', 'capsman-enhanced' ), str_replace('_', ' ', $plugin )) . '</h3>';
|
759 |
+
echo '<table class="form-table cme-checklist"><tr>';
|
760 |
+
|
761 |
+
$checks_per_row = get_option( 'cme_form-rows', 5 );
|
762 |
+
$i = 0; $first_row = true;
|
763 |
+
|
764 |
+
foreach( array_keys($_plugin_caps) as $cap_name ) {
|
765 |
+
if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) || isset($type_metacaps[$cap_name]) ) {
|
766 |
+
continue;
|
767 |
+
}
|
768 |
+
|
769 |
+
if ( ! $is_administrator && ! current_user_can($cap_name) )
|
770 |
+
continue;
|
771 |
+
|
772 |
+
if ( $i == $checks_per_row ) {
|
773 |
+
echo '</tr><tr>';
|
774 |
+
$i = 0;
|
775 |
+
}
|
776 |
+
|
777 |
+
if ( ! isset( $rcaps[$cap_name] ) )
|
778 |
+
$class = 'cap-no';
|
779 |
+
else
|
780 |
+
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
|
781 |
+
|
782 |
+
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
783 |
+
$class .= ' cap-metagroup';
|
784 |
+
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
|
785 |
+
} else {
|
786 |
+
$title_text = $cap_name;
|
787 |
+
}
|
788 |
+
|
789 |
+
$disabled = '';
|
790 |
+
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
791 |
+
$title = $title_text;
|
792 |
+
?>
|
793 |
+
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
|
794 |
+
<span>
|
795 |
+
<?php
|
796 |
+
echo str_replace( '_', ' ', $cap_name );
|
797 |
+
?>
|
798 |
+
</span></label><a href="#" class="neg-cap"> x </a>
|
799 |
+
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
|
800 |
+
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
|
801 |
+
<?php endif; ?>
|
802 |
+
</td>
|
803 |
+
|
804 |
+
<?php
|
805 |
+
++$i;
|
806 |
+
}
|
807 |
+
|
808 |
+
if ( $i == $checks_per_row ) {
|
809 |
+
echo '</tr>';
|
810 |
+
$i = 0;
|
811 |
+
} elseif ( ! $first_row ) {
|
812 |
+
// Now close a wellformed table
|
813 |
+
for ( $i; $i < $checks_per_row; $i++ ){
|
814 |
+
echo '<td> </td>';
|
815 |
+
}
|
816 |
+
echo '</tr>';
|
817 |
+
}
|
818 |
+
?>
|
819 |
+
|
820 |
+
<tr class="cme-bulk-select">
|
821 |
+
<td colspan="<?php echo $checks_per_row;?>">
|
822 |
+
<span style="float:right">
|
823 |
+
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>"> <a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
|
824 |
+
</span>
|
825 |
+
</td></tr>
|
826 |
+
|
827 |
+
</table>
|
828 |
+
<?php
|
829 |
+
}
|
830 |
+
|
831 |
+
echo '<p> </p><h3 class="cme-cap-section">' . __( 'Additional Capabilities', 'capsman-enhanced' ) . '</h3>';
|
832 |
+
|
833 |
+
?>
|
834 |
+
<table class="form-table cme-checklist">
|
835 |
+
<tr>
|
836 |
+
<?php
|
837 |
+
$i = 0; $first_row = true;
|
838 |
+
|
839 |
+
foreach( $all_capabilities as $cap_name ) {
|
840 |
+
if ( ! isset($this->capabilities[$cap_name]) )
|
841 |
+
$this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
|
842 |
+
}
|
843 |
+
|
844 |
+
uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
|
845 |
+
|
846 |
+
$additional_caps = apply_filters('publishpress_caps_manage_additional_caps', $this->capabilities);
|
847 |
+
|
848 |
+
foreach ($additional_caps as $cap_name => $cap) :
|
849 |
+
if ( isset( $type_caps[$cap_name] ) || isset($core_caps[$cap_name]) || isset($type_metacaps[$cap_name]) )
|
850 |
+
continue;
|
851 |
+
|
852 |
+
foreach(array_keys($plugin_caps) as $plugin) {
|
853 |
+
if ( in_array( $cap_name, $plugin_caps[$plugin]) ) {
|
854 |
+
continue 2;
|
855 |
+
}
|
856 |
+
}
|
857 |
+
|
858 |
+
if ( ! $is_administrator && empty( $current_user->allcaps[$cap_name] ) ) {
|
859 |
+
continue;
|
860 |
+
}
|
861 |
+
|
862 |
+
// Levels are not shown.
|
863 |
+
if ( preg_match( '/^level_(10|[0-9])$/i', $cap_name ) ) {
|
864 |
+
continue;
|
865 |
+
}
|
866 |
+
|
867 |
+
if ( $i == $checks_per_row ) {
|
868 |
+
echo '</tr><tr>';
|
869 |
+
$i = 0; $first_row = false;
|
870 |
+
}
|
871 |
+
|
872 |
+
if ( ! isset( $rcaps[$cap_name] ) )
|
873 |
+
$class = 'cap-no';
|
874 |
+
else
|
875 |
+
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
|
876 |
+
|
877 |
+
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
878 |
+
$class .= ' cap-metagroup';
|
879 |
+
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
|
880 |
+
} else {
|
881 |
+
$title_text = $cap_name;
|
882 |
+
}
|
883 |
+
|
884 |
+
$disabled = '';
|
885 |
+
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
886 |
+
|
887 |
+
if ( 'manage_capabilities' == $cap_name ) {
|
888 |
+
if (!current_user_can('administrator') && (!is_multisite() || !is_super_admin())) {
|
889 |
+
continue;
|
890 |
+
} elseif ( 'administrator' == $default ) {
|
891 |
+
$class .= ' cap-locked';
|
892 |
+
$lock_manage_caps_capability = true;
|
893 |
+
$disabled = 'disabled="disabled"';
|
894 |
+
}
|
895 |
+
}
|
896 |
+
?>
|
897 |
+
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
|
898 |
+
<span>
|
899 |
+
<?php
|
900 |
+
echo str_replace( '_', ' ', $cap );
|
901 |
+
?>
|
902 |
+
</span></label><a href="#" class="neg-cap"> x </a>
|
903 |
+
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
|
904 |
+
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
|
905 |
+
<?php endif; ?>
|
906 |
+
</td>
|
907 |
+
<?php
|
908 |
+
$i++;
|
909 |
+
endforeach;
|
910 |
+
|
911 |
+
if ( ! empty($lock_manage_caps_capability) ) {
|
912 |
+
echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
|
913 |
+
}
|
914 |
+
|
915 |
+
if ( $i == $checks_per_row ) {
|
916 |
+
echo '</tr><tr>';
|
917 |
+
$i = 0;
|
918 |
+
} else {
|
919 |
+
if ( ! $first_row ) {
|
920 |
+
// Now close a wellformed table
|
921 |
+
for ( $i; $i < $checks_per_row; $i++ ){
|
922 |
+
echo '<td> </td>';
|
923 |
+
}
|
924 |
+
echo '</tr>';
|
925 |
+
}
|
926 |
+
}
|
927 |
+
?>
|
928 |
+
|
929 |
+
<tr class="cme-bulk-select">
|
930 |
+
<td colspan="<?php echo $checks_per_row;?>">
|
931 |
+
<span style="float:right">
|
932 |
+
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>"> <a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
|
933 |
+
</span>
|
934 |
+
</td></tr>
|
935 |
+
|
936 |
+
</table>
|
937 |
+
|
938 |
+
<?php
|
939 |
+
if (array_intersect(array_keys(array_filter($type_metacaps)), $all_capabilities)) {
|
940 |
+
|
941 |
+
$_title = esc_attr(__('Meta capabilities are used in code as placeholders for other capabilities. Assiging to a role has no effect.'));
|
942 |
+
echo '<p> </p><h3 class="cme-cap-section" title="' . $_title . '">' . __( 'Invalid Capabilities', 'capsman-enhanced' ) . '</h3>';
|
943 |
+
?>
|
944 |
+
<table class="form-table cme-checklist">
|
945 |
+
<tr>
|
946 |
+
<?php
|
947 |
+
$i = 0; $first_row = true;
|
948 |
+
|
949 |
+
foreach( $all_capabilities as $cap_name ) {
|
950 |
+
if ( ! isset($this->capabilities[$cap_name]) )
|
951 |
+
$this->capabilities[$cap_name] = str_replace( '_', ' ', $cap_name );
|
952 |
+
}
|
953 |
+
|
954 |
+
uasort( $this->capabilities, 'strnatcasecmp' ); // sort by array values, but maintain keys );
|
955 |
+
|
956 |
+
foreach ( $this->capabilities as $cap_name => $cap ) :
|
957 |
+
if ( ! isset( $type_metacaps[$cap_name] ) )
|
958 |
+
continue;
|
959 |
+
|
960 |
+
if ( ! $is_administrator && empty( $current_user->allcaps[$cap_name] ) ) {
|
961 |
+
continue;
|
962 |
+
}
|
963 |
+
|
964 |
+
if ( $i == $checks_per_row ) {
|
965 |
+
echo '</tr><tr>';
|
966 |
+
$i = 0; $first_row = false;
|
967 |
+
}
|
968 |
+
|
969 |
+
if ( ! isset( $rcaps[$cap_name] ) )
|
970 |
+
$class = 'cap-no';
|
971 |
+
else
|
972 |
+
$class = ( $rcaps[$cap_name] ) ? 'cap-yes' : 'cap-neg';
|
973 |
+
|
974 |
+
if ( ! empty($pp_metagroup_caps[$cap_name]) ) {
|
975 |
+
$class .= ' cap-metagroup';
|
976 |
+
$title_text = sprintf( __( '%s: assigned by Permission Group', 'capsman-enhanced' ), $cap_name );
|
977 |
+
} else {
|
978 |
+
$title_text = $cap_name;
|
979 |
+
}
|
980 |
+
|
981 |
+
$disabled = '';
|
982 |
+
$checked = checked(1, ! empty($rcaps[$cap_name]), false );
|
983 |
+
?>
|
984 |
+
<td class="<?php echo $class; ?>"><span class="cap-x">X</span><label title="<?php echo $title_text;?>"><input type="checkbox" name="caps[<?php echo $cap_name; ?>]" value="1" <?php echo $checked . $disabled;?> />
|
985 |
+
<span>
|
986 |
+
<?php
|
987 |
+
echo str_replace( '_', ' ', $cap );
|
988 |
+
?>
|
989 |
+
</span></label><a href="#" class="neg-cap"> x </a>
|
990 |
+
<?php if ( false !== strpos( $class, 'cap-neg' ) ) :?>
|
991 |
+
<input type="hidden" class="cme-negation-input" name="caps[<?php echo $cap_name; ?>]" value="" />
|
992 |
+
<?php endif; ?>
|
993 |
+
</td>
|
994 |
+
<?php
|
995 |
+
$i++;
|
996 |
+
endforeach;
|
997 |
+
|
998 |
+
if ( ! empty($lock_manage_caps_capability) ) {
|
999 |
+
echo '<input type="hidden" name="caps[manage_capabilities]" value="1" />';
|
1000 |
+
}
|
1001 |
+
|
1002 |
+
if ( $i == $checks_per_row ) {
|
1003 |
+
echo '</tr><tr>';
|
1004 |
+
$i = 0;
|
1005 |
+
} else {
|
1006 |
+
if ( ! $first_row ) {
|
1007 |
+
// Now close a wellformed table
|
1008 |
+
for ( $i; $i < $checks_per_row; $i++ ){
|
1009 |
+
echo '<td> </td>';
|
1010 |
+
}
|
1011 |
+
echo '</tr>';
|
1012 |
+
}
|
1013 |
+
}
|
1014 |
+
?>
|
1015 |
+
|
1016 |
+
<tr class="cme-bulk-select">
|
1017 |
+
<td colspan="<?php echo $checks_per_row;?>">
|
1018 |
+
<span style="float:right">
|
1019 |
+
<input type="checkbox" class="cme-check-all" title="<?php _e('check/uncheck all', 'capsman-enhanced');?>"> <a class="cme-neg-all" href="#" title="<?php _e('negate all (storing as disabled capabilities)', 'capsman-enhanced');?>">X</a> <a class="cme-switch-all" href="#" title="<?php _e('negate none (add/remove all capabilities normally)', 'capsman-enhanced');?>">X</a>
|
1020 |
+
</span>
|
1021 |
+
</td></tr>
|
1022 |
+
|
1023 |
+
</table>
|
1024 |
+
<?php
|
1025 |
+
} // endif any invalid caps
|
1026 |
+
?>
|
1027 |
+
|
1028 |
+
<div>
|
1029 |
+
<?php
|
1030 |
+
$level = ak_caps2level($rcaps);
|
1031 |
+
?>
|
1032 |
+
<span title="<?php _e('Role level is mostly deprecated. However, it still determines eligibility for Post Author assignment and limits the application of user editing capabilities.', 'capsman-enhanced');?>">
|
1033 |
+
<?php _e('Role Level:', 'capsman-enhanced');?> <select name="level">
|
1034 |
+
<?php for ( $l = $this->max_level; $l >= 0; $l-- ) {?>
|
1035 |
+
<option value="<?php echo $l; ?>" style="text-align:right;"<?php selected($level, $l); ?>> <?php echo $l; ?> </option>
|
1036 |
+
<?php }
|
1037 |
+
?>
|
1038 |
+
</select>
|
1039 |
+
</span>
|
1040 |
+
|
1041 |
+
</div>
|
1042 |
+
</dd>
|
1043 |
+
</dl>
|
1044 |
+
|
1045 |
+
<?php
|
1046 |
+
$support_pp_only_roles = ( defined('PRESSPERMIT_ACTIVE') ) ? $pp_ui->pp_only_roles_ui( $default ) : false;
|
1047 |
+
cme_network_role_ui( $default );
|
1048 |
+
?>
|
1049 |
+
|
1050 |
+
<p class="submit">
|
1051 |
+
<input type="hidden" name="action" value="update" />
|
1052 |
+
<input type="hidden" name="current" value="<?php echo $default; ?>" />
|
1053 |
+
<input type="submit" name="SaveRole" value="<?php _e('Save Changes', 'capsman-enhanced') ?>" class="button-primary" />
|
1054 |
+
|
1055 |
+
<?php if ( current_user_can('administrator') && 'administrator' != $default ) : ?>
|
1056 |
+
<a class="ak-delete" title="<?php echo esc_attr(__('Delete this role', 'capsman-enhanced')) ?>" href="<?php echo wp_nonce_url("admin.php?page={$this->ID}&action=delete&role={$default}", 'delete-role_' . $default); ?>" onclick="if ( confirm('<?php echo esc_js(sprintf(__("You are about to delete the %s role.\n\n 'Cancel' to stop, 'OK' to delete.", 'capsman-enhanced'), $roles[$default])); ?>') ) { return true;}return false;"><?php _e('Delete Role', 'capsman-enhanced')?></a>
|
1057 |
+
<?php endif; ?>
|
1058 |
+
</p>
|
1059 |
+
|
1060 |
+
</td>
|
1061 |
+
<td class="sidebar">
|
1062 |
+
<dl>
|
1063 |
+
<dt><?php if ( defined('WPLANG') && WPLANG ) _e('Select New Role', 'capsman-enhanced'); else echo('Select Role to View / Edit'); ?></dt>
|
1064 |
+
<dd style="text-align:center;">
|
1065 |
+
<p><select name="role">
|
1066 |
+
<?php
|
1067 |
+
foreach ( $roles as $role => $name ) {
|
1068 |
+
$name = translate_user_role($name);
|
1069 |
+
echo '<option value="' . $role .'"'; selected($default, $role); echo '> ' . $name . ' </option>';
|
1070 |
+
}
|
1071 |
+
?>
|
1072 |
+
</select><span style="margin-left:20px"><input type="submit" name="LoadRole" value="<?php if ( defined('WPLANG') && WPLANG ) _e('Change', 'capsman-enhanced'); else echo('Load'); ?>" class="button" /></span></p>
|
1073 |
+
</dd>
|
1074 |
+
</dl>
|
1075 |
+
|
1076 |
+
<script type="text/javascript">
|
1077 |
+
/* <![CDATA[ */
|
1078 |
+
jQuery(document).ready( function($) {
|
1079 |
+
$('select[name="role"]').val('<?php echo $default;?>');
|
1080 |
+
|
1081 |
+
$('input.button[name="LoadRole"]').click(function(){
|
1082 |
+
$('#publishpress_caps_form').attr('action', 'admin.php?page=capsman&role=' + $('select[name="role"]').val());
|
1083 |
+
});
|
1084 |
+
});
|
1085 |
+
/* ]]> */
|
1086 |
+
</script>
|
1087 |
+
|
1088 |
+
<?php do_action('publishpress-caps_sidebar_top');?>
|
1089 |
+
|
1090 |
+
<dl>
|
1091 |
+
<dt><?php _e('Create New Role', 'capsman-enhanced'); ?></dt>
|
1092 |
+
<dd style="text-align:center;">
|
1093 |
+
<?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
|
1094 |
+
<p><input type="text" name="create-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
|
1095 |
+
|
1096 |
+
<?php if( $support_pp_only_roles ) : ?>
|
1097 |
+
<label for="new_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="new_role_pp_only" id="new_role_pp_only" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
|
1098 |
+
<?php endif; ?>
|
1099 |
+
|
1100 |
+
<br />
|
1101 |
+
<input type="submit" name="CreateRole" value="<?php _e('Create', 'capsman-enhanced') ?>" class="button" />
|
1102 |
+
</p>
|
1103 |
+
</dd>
|
1104 |
+
</dl>
|
1105 |
+
|
1106 |
+
<dl>
|
1107 |
+
<dt><?php defined('WPLANG') && WPLANG ? _e('Copy this role to', 'capsman-enhanced') : printf('Copy %s Role', translate_user_role($roles[$default])); ?></dt>
|
1108 |
+
<dd style="text-align:center;">
|
1109 |
+
<?php $class = ( $support_pp_only_roles ) ? 'tight-text' : 'regular-text'; ?>
|
1110 |
+
<p><input type="text" name="copy-name" class="<?php echo $class;?>" placeholder="<?php _e('Role Name', 'capsman-enhanced') ?>" />
|
1111 |
+
|
1112 |
+
<?php if( $support_pp_only_roles ) : ?>
|
1113 |
+
<label for="copy_role_pp_only" title="<?php _e('Make role available for supplemental assignment to Permission Groups only', 'capsman-enhanced');?>"> <input type="checkbox" name="copy_role_pp_only" id="copy_role_pp_only" value="1"> <?php _e('hidden', 'capsman-enhanced'); ?> </label>
|
1114 |
+
<?php endif; ?>
|
1115 |
+
|
1116 |
+
<br />
|
1117 |
+
<input type="submit" name="CopyRole" value="<?php _e('Copy', 'capsman-enhanced') ?>" class="button" />
|
1118 |
+
</p>
|
1119 |
+
</dd>
|
1120 |
+
</dl>
|
1121 |
+
|
1122 |
+
<dl>
|
1123 |
+
<dt><?php _e('Add Capability', 'capsman-enhanced'); ?></dt>
|
1124 |
+
<dd style="text-align:center;">
|
1125 |
+
<p><input type="text" name="capability-name" class="regular-text" placeholder="<?php echo 'capability_name';?>" /><br />
|
1126 |
+
<input type="submit" name="AddCap" value="<?php _e('Add to role', 'capsman-enhanced') ?>" class="button" /></p>
|
1127 |
+
</dd>
|
1128 |
+
</dl>
|
1129 |
+
|
1130 |
+
<!-- <dl class="cme-backup-tool">
|
1131 |
+
<dt><?php _e('Backup Tool', 'capsman-enhanced'); ?></dt>
|
1132 |
+
<dd style="text-align:center;">
|
1133 |
+
<p><a href="admin.php?page=capsman-tool"><?php _e('Backup / Restore Roles', 'capsman-enhanced');?></a></p>
|
1134 |
+
</dd>
|
1135 |
+
</dl> -->
|
1136 |
+
|
1137 |
+
<dl>
|
1138 |
+
<dt><?php _e('Related Permissions Plugins', 'capsman-enhanced'); ?></dt>
|
1139 |
+
<dd>
|
1140 |
+
<ul>
|
1141 |
+
<li><a href="https://publishpress.com/ma/" target="_blank"><?php _e('Multiple Authors', 'capsman-enhanced');?></a></li>
|
1142 |
+
</li>
|
1143 |
+
|
1144 |
+
<li><a href="#pp-more"><?php _e('PublishPress Permissions', 'capsman-enhanced');?></a>
|
1145 |
+
</li>
|
1146 |
+
|
1147 |
+
<?php $_url = "plugin-install.php?tab=plugin-information&plugin=publishpress&TB_iframe=true&width=640&height=678";
|
1148 |
+
$url = ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
|
1149 |
+
?>
|
1150 |
+
<li><a class="thickbox" href="<?php echo $url;?>"><?php _e('PublishPress', 'capsman-enhanced');?></a></li>
|
1151 |
+
|
1152 |
+
<?php $_url = "plugin-install.php?tab=plugin-information&plugin=revisionary&TB_iframe=true&width=640&height=678";
|
1153 |
+
$url = ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
|
1154 |
+
?>
|
1155 |
+
<li><a class="thickbox" href="<?php echo $url;?>"><?php _e('PublishPress Revisions', 'capsman-enhanced');?></a></li>
|
1156 |
+
|
1157 |
+
<li class="publishpress-contact"><a href="https://publishpress.com/contact" target="_blank"><?php _e('Help / Contact Form', 'capsman-enhanced');?></a></li>
|
1158 |
+
|
1159 |
+
</ul>
|
1160 |
+
</dd>
|
1161 |
+
</dl>
|
1162 |
+
|
1163 |
+
<?php
|
1164 |
+
$pp_ui->pp_types_ui( $defined['type'] );
|
1165 |
+
$pp_ui->pp_taxonomies_ui( $defined['taxonomy'] );
|
1166 |
+
|
1167 |
+
do_action('publishpress-caps_sidebar_bottom');
|
1168 |
+
?>
|
1169 |
+
</td>
|
1170 |
+
</tr>
|
1171 |
+
</table>
|
1172 |
+
</fieldset>
|
1173 |
+
</form>
|
1174 |
+
|
1175 |
+
<?php if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION') || get_option('cme_display_branding')) {
|
1176 |
+
cme_publishpressFooter();
|
1177 |
+
}
|
1178 |
+
?>
|
1179 |
+
</div>
|
1180 |
+
|
1181 |
+
<?php
|
1182 |
+
function cme_network_role_ui( $default ) {
|
1183 |
+
if ( ! is_multisite() || ! is_super_admin() || ( 1 != get_current_blog_id() ) )
|
1184 |
+
return false;
|
1185 |
+
?>
|
1186 |
+
|
1187 |
+
<div style="float:right;margin-left:10px;margin-right:10px">
|
1188 |
+
<?php
|
1189 |
+
if ( ! $autocreate_roles = get_site_option( 'cme_autocreate_roles' ) )
|
1190 |
+
$autocreate_roles = array();
|
1191 |
+
|
1192 |
+
$checked = ( in_array( $default, $autocreate_roles ) ) ? 'checked="checked"': '';
|
1193 |
+
?>
|
1194 |
+
<div style="margin-bottom: 5px">
|
1195 |
+
<label for="cme_autocreate_role" title="<?php _e('Create this role definition in new (future) sites', 'capsman-enhanced');?>"><input type="checkbox" name="cme_autocreate_role" id="cme_autocreate_role" value="1" <?php echo $checked;?>> <?php _e('include in new sites', 'capsman-enhanced'); ?> </label>
|
1196 |
+
</div>
|
1197 |
+
<div>
|
1198 |
+
<label for="cme_net_sync_role" title="<?php echo esc_attr(__('Copy / update this role definition to all sites now', 'capsman-enhanced'));?>"><input type="checkbox" name="cme_net_sync_role" id="cme_net_sync_role" value="1"> <?php _e('sync role to all sites now', 'capsman-enhanced'); ?> </label>
|
1199 |
+
</div>
|
1200 |
+
</div>
|
1201 |
+
<?php
|
1202 |
+
return true;
|
1203 |
+
}
|
1204 |
+
|
1205 |
+
function cme_plugin_info_url( $plugin_slug ) {
|
1206 |
+
$_url = "plugin-install.php?tab=plugin-information&plugin=$plugin_slug&TB_iframe=true&width=640&height=678";
|
1207 |
+
return ( is_multisite() ) ? network_admin_url($_url) : admin_url($_url);
|
1208 |
+
}
|
includes/backup-handler.php
CHANGED
@@ -5,7 +5,7 @@ class Capsman_BackupHandler
|
|
5 |
var $cm;
|
6 |
|
7 |
function __construct( $manager_obj ) {
|
8 |
-
if ( !
|
9 |
wp_die( __( 'You do not have permission to restore roles.', 'capsman-enhanced' ) );
|
10 |
|
11 |
$this->cm = $manager_obj;
|
5 |
var $cm;
|
6 |
|
7 |
function __construct( $manager_obj ) {
|
8 |
+
if ((!is_multisite() || !is_super_admin()) && !current_user_can('administrator') && !current_user_can('restore_roles'))
|
9 |
wp_die( __( 'You do not have permission to restore roles.', 'capsman-enhanced' ) );
|
10 |
|
11 |
$this->cm = $manager_obj;
|
includes/cap-helper.php
CHANGED
@@ -197,7 +197,7 @@ class CME_Cap_Helper {
|
|
197 |
// need this for casting to other types even if "post" type is not enabled for PP filtering
|
198 |
$wp_post_types['post']->cap->set_posts_status = 'set_posts_status';
|
199 |
|
200 |
-
if ( current_user_can(
|
201 |
global $current_user;
|
202 |
$current_user->allcaps = array_merge( $current_user->allcaps, array_fill_keys( array_keys( $this->all_type_caps ), true ) );
|
203 |
|
@@ -360,7 +360,7 @@ class CME_Cap_Helper {
|
|
360 |
|
361 |
$this->all_taxonomy_caps = array_merge( $this->all_taxonomy_caps, array( 'assign_term' => true ) );
|
362 |
|
363 |
-
if ( current_user_can(
|
364 |
global $current_user;
|
365 |
$current_user->allcaps = array_merge( $current_user->allcaps, array_fill_keys( array_keys( $this->all_taxonomy_caps ), true ) );
|
366 |
|
197 |
// need this for casting to other types even if "post" type is not enabled for PP filtering
|
198 |
$wp_post_types['post']->cap->set_posts_status = 'set_posts_status';
|
199 |
|
200 |
+
if ((is_multisite() && is_super_admin()) || current_user_can('administrator') || current_user_can('pp_administer_content')) { // @ todo: support restricted administrator
|
201 |
global $current_user;
|
202 |
$current_user->allcaps = array_merge( $current_user->allcaps, array_fill_keys( array_keys( $this->all_type_caps ), true ) );
|
203 |
|
360 |
|
361 |
$this->all_taxonomy_caps = array_merge( $this->all_taxonomy_caps, array( 'assign_term' => true ) );
|
362 |
|
363 |
+
if ((is_multisite() && is_super_admin()) || current_user_can('administrator') || current_user_can('pp_administer_content')) { // @ todo: support restricted administrator
|
364 |
global $current_user;
|
365 |
$current_user->allcaps = array_merge( $current_user->allcaps, array_fill_keys( array_keys( $this->all_taxonomy_caps ), true ) );
|
366 |
|
includes/functions-admin.php
CHANGED
@@ -8,11 +8,11 @@ function cme_submenus() {
|
|
8 |
$admin->add_cap('manage_capabilities');
|
9 |
}
|
10 |
|
11 |
-
$cap_name = (is_super_admin()) ? 'read' : 'manage_capabilities';
|
12 |
|
13 |
-
|
14 |
|
15 |
-
|
16 |
|
17 |
if (defined('PUBLISHPRESS_PERMISSIONS_MENU_GROUPING')) {
|
18 |
foreach (get_option('active_plugins') as $plugin_file) {
|
@@ -22,26 +22,28 @@ function cme_submenus() {
|
|
22 |
}
|
23 |
}
|
24 |
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
$menu_order
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
|
|
|
|
45 |
}
|
46 |
|
47 |
function cme_fakefunc() {
|
8 |
$admin->add_cap('manage_capabilities');
|
9 |
}
|
10 |
|
11 |
+
$cap_name = (is_multisite() && is_super_admin()) ? 'read' : 'manage_capabilities';
|
12 |
|
13 |
+
$permissions_title = __('Capabilities', 'capsman-enhanced');
|
14 |
|
15 |
+
$menu_order = 72;
|
16 |
|
17 |
if (defined('PUBLISHPRESS_PERMISSIONS_MENU_GROUPING')) {
|
18 |
foreach (get_option('active_plugins') as $plugin_file) {
|
22 |
}
|
23 |
}
|
24 |
|
25 |
+
add_menu_page(
|
26 |
+
$permissions_title,
|
27 |
+
$permissions_title,
|
28 |
+
$cap_name,
|
29 |
+
'capsman',
|
30 |
+
'cme_fakefunc',
|
31 |
+
'dashicons-admin-network',
|
32 |
$menu_order
|
33 |
+
);
|
34 |
+
|
35 |
+
add_submenu_page('capsman', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, 'capsman' . '-tool', 'cme_fakefunc');
|
36 |
+
|
37 |
+
if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION')) {
|
38 |
+
add_submenu_page(
|
39 |
+
'capsman',
|
40 |
+
__('Upgrade to Pro', 'capsman-enhanced'),
|
41 |
+
__('Upgrade to Pro', 'capsman-enhanced'),
|
42 |
+
'read',
|
43 |
+
'capabilities-pro',
|
44 |
+
'cme_fakefunc'
|
45 |
+
);
|
46 |
+
}
|
47 |
}
|
48 |
|
49 |
function cme_fakefunc() {
|
includes/manager.php
CHANGED
@@ -275,7 +275,7 @@ class CapabilityManager
|
|
275 |
}
|
276 |
|
277 |
public function cme_menu() {
|
278 |
-
$cap_name = ( is_super_admin()
|
279 |
|
280 |
$permissions_title = __('Capabilities', 'capsman-enhanced');
|
281 |
|
@@ -301,16 +301,18 @@ class CapabilityManager
|
|
301 |
|
302 |
add_submenu_page('capsman', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, $this->ID . '-tool', array($this, 'backupTool'));
|
303 |
|
304 |
-
|
305 |
-
|
306 |
-
|
307 |
-
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
|
|
|
|
312 |
}
|
313 |
-
|
314 |
/**
|
315 |
* Sets the 'manage_capabilities' cap to the administrator role.
|
316 |
*
|
@@ -400,9 +402,9 @@ class CapabilityManager
|
|
400 |
|
401 |
function processRoleUpdate() {
|
402 |
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && ( ! empty($_REQUEST['SaveRole']) || ! empty($_REQUEST['AddCap']) ) ) {
|
403 |
-
if ( ! current_user_can('
|
404 |
// TODO: Implement exceptions.
|
405 |
-
wp_die('<strong>' .__('
|
406 |
}
|
407 |
|
408 |
if ( ! empty($_REQUEST['current']) ) { // don't process role update unless form variable is received
|
@@ -441,9 +443,9 @@ class CapabilityManager
|
|
441 |
* @return void
|
442 |
*/
|
443 |
function generalManager () {
|
444 |
-
if ( ! current_user_can('
|
445 |
// TODO: Implement exceptions.
|
446 |
-
wp_die('<strong>' .__('
|
447 |
}
|
448 |
|
449 |
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
|
@@ -470,14 +472,14 @@ class CapabilityManager
|
|
470 |
$capsman_modify->adminDeleteRole();
|
471 |
}
|
472 |
|
473 |
-
if (
|
474 |
if (empty($_POST) && !empty($_REQUEST['role'])) {
|
475 |
$this->current = $_REQUEST['role'];
|
476 |
}
|
477 |
}
|
478 |
|
479 |
if (!isset($this->current) || !get_role($this->current)) {
|
480 |
-
|
481 |
}
|
482 |
|
483 |
if ( ! in_array($this->current, $roles) ) { // Current role has been deleted.
|
@@ -614,9 +616,9 @@ class CapabilityManager
|
|
614 |
*/
|
615 |
function backupTool ()
|
616 |
{
|
617 |
-
if ( ! current_user_can('
|
618 |
// TODO: Implement exceptions.
|
619 |
-
wp_die('<strong>' .__('
|
620 |
}
|
621 |
|
622 |
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
|
275 |
}
|
276 |
|
277 |
public function cme_menu() {
|
278 |
+
$cap_name = (is_multisite() && is_super_admin()) ? 'read' : 'manage_capabilities';
|
279 |
|
280 |
$permissions_title = __('Capabilities', 'capsman-enhanced');
|
281 |
|
301 |
|
302 |
add_submenu_page('capsman', __('Backup', 'capsman-enhanced'), __('Backup', 'capsman-enhanced'), $cap_name, $this->ID . '-tool', array($this, 'backupTool'));
|
303 |
|
304 |
+
if (!defined('PUBLISHPRESS_CAPS_PRO_VERSION')) {
|
305 |
+
add_submenu_page(
|
306 |
+
'capsman',
|
307 |
+
__('Upgrade to Pro', 'capsman-enhanced'),
|
308 |
+
__('Upgrade to Pro', 'capsman-enhanced'),
|
309 |
+
'read',
|
310 |
+
'capabilities-pro',
|
311 |
+
array($this, 'generalManager')
|
312 |
+
);
|
313 |
+
}
|
314 |
}
|
315 |
+
|
316 |
/**
|
317 |
* Sets the 'manage_capabilities' cap to the administrator role.
|
318 |
*
|
402 |
|
403 |
function processRoleUpdate() {
|
404 |
if ( 'POST' == $_SERVER['REQUEST_METHOD'] && ( ! empty($_REQUEST['SaveRole']) || ! empty($_REQUEST['AddCap']) ) ) {
|
405 |
+
if ((!is_multisite() || !is_super_admin()) && !current_user_can('administrator') && !current_user_can('manage_capabilities')) {
|
406 |
// TODO: Implement exceptions.
|
407 |
+
wp_die('<strong>' .__('You do not have permission to manage capabilities.', 'capsman-enhanced') . '</strong>');
|
408 |
}
|
409 |
|
410 |
if ( ! empty($_REQUEST['current']) ) { // don't process role update unless form variable is received
|
443 |
* @return void
|
444 |
*/
|
445 |
function generalManager () {
|
446 |
+
if ((!is_multisite() || !is_super_admin()) && !current_user_can('administrator') && !current_user_can('manage_capabilities')) {
|
447 |
// TODO: Implement exceptions.
|
448 |
+
wp_die('<strong>' .__('You do not have permission to manage capabilities.', 'capsman-enhanced') . '</strong>');
|
449 |
}
|
450 |
|
451 |
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
|
472 |
$capsman_modify->adminDeleteRole();
|
473 |
}
|
474 |
|
475 |
+
if (!isset($this->current)) { // By default, we manage the default role
|
476 |
if (empty($_POST) && !empty($_REQUEST['role'])) {
|
477 |
$this->current = $_REQUEST['role'];
|
478 |
}
|
479 |
}
|
480 |
|
481 |
if (!isset($this->current) || !get_role($this->current)) {
|
482 |
+
$this->current = get_option('default_role');
|
483 |
}
|
484 |
|
485 |
if ( ! in_array($this->current, $roles) ) { // Current role has been deleted.
|
616 |
*/
|
617 |
function backupTool ()
|
618 |
{
|
619 |
+
if ((!is_multisite() || !is_super_admin()) && !current_user_can('administrator') && !current_user_can('restore_roles')) {
|
620 |
// TODO: Implement exceptions.
|
621 |
+
wp_die('<strong>' .__('You do not have permission to restore roles.', 'capsman-enhanced') . '</strong>');
|
622 |
}
|
623 |
|
624 |
if ( 'POST' == $_SERVER['REQUEST_METHOD'] ) {
|
lang/capsman.mo
CHANGED
Binary file
|
lang/capsman.po
CHANGED
@@ -2,8 +2,8 @@ msgid ""
|
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Capability Manager Enhanced\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
-
"POT-Creation-Date: 2020-03-
|
6 |
-
"PO-Revision-Date: 2020-03-
|
7 |
"Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
|
8 |
"Language-Team: PublishPress <help@publishpress.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
@@ -601,8 +601,7 @@ msgstr ""
|
|
601 |
|
602 |
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:405
|
603 |
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:446
|
604 |
-
|
605 |
-
msgid "What do you think you're doing?!?"
|
606 |
msgstr ""
|
607 |
|
608 |
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:460
|
2 |
msgstr ""
|
3 |
"Project-Id-Version: Capability Manager Enhanced\n"
|
4 |
"Report-Msgid-Bugs-To: \n"
|
5 |
+
"POT-Creation-Date: 2020-03-17 18:17-0500\n"
|
6 |
+
"PO-Revision-Date: 2020-03-17 18:17-0500\n"
|
7 |
"Last-Translator: Kevin Behrens <kevin@publishpress.com>\n"
|
8 |
"Language-Team: PublishPress <help@publishpress.com>\n"
|
9 |
"MIME-Version: 1.0\n"
|
601 |
|
602 |
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:405
|
603 |
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:446
|
604 |
+
msgid "You do not have permission to manage capabilities."
|
|
|
605 |
msgstr ""
|
606 |
|
607 |
#: F:\snapshot\capability-manager-enhanced/includes/manager.php:460
|
readme.txt
CHANGED
@@ -1,331 +1,365 @@
|
|
1 |
-
=== PublishPress Capabilities ===
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
-
|
42 |
-
|
43 |
-
|
44 |
-
|
45 |
-
|
46 |
-
|
47 |
-
|
48 |
-
|
49 |
-
|
50 |
-
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
|
55 |
-
|
56 |
-
|
57 |
-
|
58 |
-
|
59 |
-
|
60 |
-
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
=
|
69 |
-
|
70 |
-
|
71 |
-
|
72 |
-
|
73 |
-
|
74 |
-
|
75 |
-
|
76 |
-
|
77 |
-
|
78 |
-
|
79 |
-
|
80 |
-
|
81 |
-
|
82 |
-
|
83 |
-
|
84 |
-
|
85 |
-
|
86 |
-
|
87 |
-
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
|
92 |
-
|
93 |
-
|
94 |
-
|
95 |
-
|
96 |
-
|
97 |
-
|
98 |
-
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
108 |
-
|
109 |
-
|
110 |
-
|
111 |
-
|
112 |
-
|
113 |
-
|
114 |
-
|
115 |
-
|
116 |
-
|
117 |
-
|
118 |
-
|
119 |
-
* Fixed :
|
120 |
-
*
|
121 |
-
|
122 |
-
= 1.
|
123 |
-
*
|
124 |
-
* Fixed :
|
125 |
-
|
126 |
-
|
127 |
-
*
|
128 |
-
|
129 |
-
= 1.
|
130 |
-
* Fixed :
|
131 |
-
|
132 |
-
= 1.
|
133 |
-
*
|
134 |
-
* Feature :
|
135 |
-
* Feature :
|
136 |
-
*
|
137 |
-
*
|
138 |
-
*
|
139 |
-
|
140 |
-
|
141 |
-
*
|
142 |
-
*
|
143 |
-
*
|
144 |
-
* Change :
|
145 |
-
|
146 |
-
|
147 |
-
|
148 |
-
|
149 |
-
|
150 |
-
* Feature :
|
151 |
-
*
|
152 |
-
*
|
153 |
-
*
|
154 |
-
|
155 |
-
|
156 |
-
*
|
157 |
-
*
|
158 |
-
*
|
159 |
-
|
160 |
-
|
161 |
-
*
|
162 |
-
|
163 |
-
|
164 |
-
|
165 |
-
|
166 |
-
|
167 |
-
|
168 |
-
* Fixed :
|
169 |
-
|
170 |
-
|
171 |
-
|
172 |
-
*
|
173 |
-
|
174 |
-
= 1.
|
175 |
-
*
|
176 |
-
|
177 |
-
= 1.
|
178 |
-
* Fixed :
|
179 |
-
|
180 |
-
= 1.
|
181 |
-
*
|
182 |
-
*
|
183 |
-
*
|
184 |
-
*
|
185 |
-
|
186 |
-
|
187 |
-
|
188 |
-
|
189 |
-
*
|
190 |
-
*
|
191 |
-
*
|
192 |
-
*
|
193 |
-
*
|
194 |
-
|
195 |
-
|
196 |
-
|
197 |
-
|
198 |
-
*
|
199 |
-
|
200 |
-
|
201 |
-
*
|
202 |
-
|
203 |
-
= 1.5 =
|
204 |
-
* Feature :
|
205 |
-
* Feature :
|
206 |
-
* Feature :
|
207 |
-
|
208 |
-
|
209 |
-
*
|
210 |
-
*
|
211 |
-
|
212 |
-
|
213 |
-
*
|
214 |
-
|
215 |
-
= 1.
|
216 |
-
*
|
217 |
-
*
|
218 |
-
|
219 |
-
|
220 |
-
*
|
221 |
-
|
222 |
-
|
223 |
-
*
|
224 |
-
|
225 |
-
|
226 |
-
|
227 |
-
|
228 |
-
|
229 |
-
*
|
230 |
-
*
|
231 |
-
*
|
232 |
-
*
|
233 |
-
|
234 |
-
= 1.
|
235 |
-
*
|
236 |
-
|
237 |
-
|
238 |
-
* Compat :
|
239 |
-
|
240 |
-
|
241 |
-
*
|
242 |
-
*
|
243 |
-
*
|
244 |
-
|
245 |
-
= 1.
|
246 |
-
* Fixed :
|
247 |
-
|
248 |
-
|
249 |
-
|
250 |
-
|
251 |
-
|
252 |
-
*
|
253 |
-
|
254 |
-
|
255 |
-
*
|
256 |
-
*
|
257 |
-
|
258 |
-
|
259 |
-
*
|
260 |
-
* Press Permit
|
261 |
-
|
262 |
-
|
263 |
-
|
264 |
-
*
|
265 |
-
|
266 |
-
|
267 |
-
*
|
268 |
-
*
|
269 |
-
*
|
270 |
-
*
|
271 |
-
*
|
272 |
-
*
|
273 |
-
|
274 |
-
|
275 |
-
|
276 |
-
|
277 |
-
*
|
278 |
-
|
279 |
-
|
280 |
-
*
|
281 |
-
|
282 |
-
= 1.
|
283 |
-
*
|
284 |
-
|
285 |
-
|
286 |
-
*
|
287 |
-
|
288 |
-
|
289 |
-
|
290 |
-
*
|
291 |
-
|
292 |
-
|
293 |
-
|
294 |
-
|
295 |
-
|
296 |
-
*
|
297 |
-
|
298 |
-
= 1.
|
299 |
-
*
|
300 |
-
|
301 |
-
|
302 |
-
|
303 |
-
*
|
304 |
-
*
|
305 |
-
|
306 |
-
= 1.2 =
|
307 |
-
*
|
308 |
-
|
309 |
-
|
310 |
-
|
311 |
-
|
312 |
-
|
313 |
-
|
314 |
-
|
315 |
-
|
316 |
-
|
317 |
-
*
|
318 |
-
|
319 |
-
|
320 |
-
|
321 |
-
|
322 |
-
|
323 |
-
|
324 |
-
= 1.3.2 =
|
325 |
-
|
326 |
-
|
327 |
-
= 1.3.1 =
|
328 |
-
|
329 |
-
|
330 |
-
= 1.3 =
|
331 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
=== PublishPress Capabilities: Manage WordPress Permissions and Edit User Roles ===
|
2 |
+
|
3 |
+
Contributors: publishpress, kevinB, stevejburge, andergmartins
|
4 |
+
Author: PublishPress
|
5 |
+
Author URI: https://publishpress.com
|
6 |
+
Tags: user roles, capabilities, permissions, authors, editors, post types, taxonomies
|
7 |
+
Requires at least: 4.9.7
|
8 |
+
Tested up to: 5.4
|
9 |
+
Requires PHP: 5.6.20
|
10 |
+
Stable tag: 1.9.3
|
11 |
+
License: GPLv3
|
12 |
+
License URI: https://www.gnu.org/licenses/gpl-3.0.html
|
13 |
+
|
14 |
+
PublishPress Capabilities is the best plugin to customize your permissions and user roles. You can control who has access to your WordPress site.
|
15 |
+
|
16 |
+
== Description ==
|
17 |
+
|
18 |
+
[PublishPress Capabilities](https://publishpress.com/capabilities/) gives you control over all the permissions on your WordPress site. You can customize all the user roles on your site, from Administrators and Editors to Authors, Contributors, Subscribers and custom roles. Each role can have the exact permissions that your site needs.
|
19 |
+
|
20 |
+
PublishPress Capabilities allows you to modify existing roles, but you can also create new roles. These roles can be added to single sites or to an entire multisite network.
|
21 |
+
|
22 |
+
PublishPress Capabilities is safe to use. Every time you change your site's permissions, PublishPress Capabilities will take a backup that you can restore if anything goes wrong. You can use these backups to migrate your roles and permissions from one site to another.
|
23 |
+
|
24 |
+
= Control User Permissions =
|
25 |
+
|
26 |
+
PublishPress Capabilities gives you detailed control over all the permissions on your WordPress site. You can customize all the user roles on your site, from Administrator to Subscriber.
|
27 |
+
|
28 |
+
With Capabilities, you can choose who can Publish, Read, Edit and Delete content. You can choose permissions for posts, pages, custom content types, categories, tags, and more.
|
29 |
+
[Click here for your quick start guide to PublishPress Capabilities](https://publishpress.com/knowledge-base/permissions-start/).
|
30 |
+
|
31 |
+
= Capabilities for any Post Type =
|
32 |
+
|
33 |
+
Many WordPress users have sites with custom post types. This can be done using custom code, a theme, or with a plugin. No matter how your post type is created, PublishPress Capabilities lets you enforce and assign distinct capabilities for your post type.
|
34 |
+
[Click here to see how to control post type permissions](https://publishpress.com/knowledge-base/custom-post-types-capability/).
|
35 |
+
|
36 |
+
= Permissions for Custom Statuses =
|
37 |
+
|
38 |
+
This option will appear if you have the [PublishPress](https://publishpress.com/publishpress) plugin installed to create and configure custom statuses. With Capabilities Pro, you can decide which user roles are able to send posts to each status. For status-specific editing control, also activate [PublishPress Permissions Pro](https://publishpress.com/presspermit) and its Status Control module.
|
39 |
+
[Click here to see how to manage permissions for statuses](https://publishpress.com/knowledge-base/permissions-for-custom-statuses/).
|
40 |
+
|
41 |
+
= Capabilities for any Taxonomy =
|
42 |
+
|
43 |
+
The PublishPress Capabilities plugin allows you to add extra permissions to the taxonomies on your site. This feature includes the default Categories and Tags, but also applies to other taxonomies. For example, in WooCommerce you can apply custom permissions to Product categories, Product tags, and Product shipping classes. You can enforce and assign "Manage", "Edit" and "Assign" distinct capabilities for all your taxonomies.
|
44 |
+
[Click here to learn about taxonomy permissions](https://publishpress.com/knowledge-base/taxonomy-specific-capabilities/).
|
45 |
+
|
46 |
+
= Backup and Restore Roles and Capabilities =
|
47 |
+
|
48 |
+
PublishPress Capabilities offers you the ability to back up and restore your permissions. This feature is very helpful if you want to test out changes on your site, or if you've installed a new plugin that has changed your site's permissions.
|
49 |
+
|
50 |
+
Every time you change your permissions, the PublishPress Capabilities plugin will now automatically create a backup. If you make a mistake, go to the “Backup” menu link and you'll be able to roll back to a previous version.
|
51 |
+
[Click here to see how to backup permissions](https://publishpress.com/knowledge-base/backup-restore-permissions/).
|
52 |
+
|
53 |
+
= Create or Copy User Roles =
|
54 |
+
|
55 |
+
With PublishPress Capabilities you can create or copy any existing WordPress user role. These roles can be customized in exactly the same way as the default WordPress roles. These new roles can be added to single sites or to an entire multisite network.
|
56 |
+
[Click here to see how to create or copy user roles](https://publishpress.com/knowledge-base/create-or-copy-user-roles/).
|
57 |
+
|
58 |
+
= Support for Media Library Permissions =
|
59 |
+
|
60 |
+
PublishPress Capabilities enables you to decide who can upload, edit and delete files from your site's Media Library. By default, only Administrators are able to delete files in your Media Library. Subscribers and Contributors are not even allowed to upload files. You can customize these permissions for the Media Library and also the Featured Image box.
|
61 |
+
[Click here to learn about Media Library permissions](https://publishpress.com/knowledge-base/control-media-library-access/).
|
62 |
+
|
63 |
+
= Support for WooCommerce Permissions =
|
64 |
+
|
65 |
+
We mentioned earlier that PublishPress Capabilities has special support for WooCommerce taxonomies. This is true for the rest of WooCommerce also. With PublishPress Capabilities you can control permissions for WooCommerce products, orders and coupons.
|
66 |
+
[Click here to learn about WooCommerce permissions](https://publishpress.com/knowledge-base/woocommerce-permissons/).
|
67 |
+
|
68 |
+
= WordPress Multisite support =
|
69 |
+
|
70 |
+
PublishPress Capabilities allows you to control permissions on a single site or across your whole network. Every time you update permissions in PublishPress Capabilities, you can choose to sync those changes across your multisite network.
|
71 |
+
[Click here to learn about multisite permissions](https://publishpress.com/knowledge-base/multisite-network/).
|
72 |
+
|
73 |
+
= Join PublishPress and get the Pro plugins =
|
74 |
+
|
75 |
+
The Pro versions of the PublishPress plugins are well worth your investment. The Pro versions have extra features and faster support. [Click here to join PublishPress](https://publishpress.com/pricing/).
|
76 |
+
|
77 |
+
Join PublishPress and you'll get access to these 6 Pro plugins:
|
78 |
+
|
79 |
+
* [PublishPress Authors Pro](https://publishpress.com/authors) allows you to add multiple authors and guest authors to WordPress posts.
|
80 |
+
* [PublishPress Capabilities Pro](https://publishpress.com/capabilities) is the plugin to manage your WordPress user roles, permissions, and capabilities.
|
81 |
+
* [PublishPress Checklists Pro](https://publishpress.com/checklists) enables you to define tasks that must be completed before content is published.
|
82 |
+
* [PublishPress Permissions Pro](https://publishpress.com/permissions) is the plugin for advanced WordPress permissions.
|
83 |
+
* [PublishPress Pro](https://publishpress.com/publishpress) is the plugin for managing and scheduling WordPress content.
|
84 |
+
* [PublishPress Revisions Pro](https://publishpress.com/revisions) allows you to update your published pages with teamwork and precision.
|
85 |
+
|
86 |
+
Together, these plugins are a suite of powerful publishing tools for WordPress. If you need to create a professional workflow in WordPress, with moderation, revisions, permissions and more … then you should try PublishPress.
|
87 |
+
|
88 |
+
= Bug Reports =
|
89 |
+
|
90 |
+
Bug reports for PublishPress Capabilities are welcomed in our [repository on GitHub](https://github.com/publishpress/publishpress-capabilities). Please note that GitHub is not a support forum, and that issues that aren't properly qualified as bugs will be closed.
|
91 |
+
|
92 |
+
= Follow the PublishPress team =
|
93 |
+
|
94 |
+
Follow PublishPress on [Facebook](https://www.facebook.com/publishpress), [Twitter](https://www.twitter.com/publishpresscom) and [YouTube](https://www.youtube.com/publishpress).
|
95 |
+
|
96 |
+
== Screenshots ==
|
97 |
+
|
98 |
+
1. Control user permissions
|
99 |
+
2. Create and copy user roles
|
100 |
+
3. Content permissions
|
101 |
+
4. Permissions for Custom Statuses
|
102 |
+
5. Enforce Type-Specific Capabilities
|
103 |
+
6. Enforce Taxonomy-Specific Capabilities
|
104 |
+
7. Detailed Taxonomy Capabilities
|
105 |
+
8. Automatic or Manual Capabilities Backup, Restore
|
106 |
+
9. Control WooCommerce Capabilities
|
107 |
+
10. PublishPress Permission integration (showing capabilities from supplemental roles)
|
108 |
+
11. Multisite support
|
109 |
+
|
110 |
+
== Upgrade Notice ==
|
111 |
+
|
112 |
+
= 1.5.1 =
|
113 |
+
Fixed : Non-administrators with user editing capabilities could add new Administrators
|
114 |
+
|
115 |
+
== Changelog ==
|
116 |
+
|
117 |
+
= 1.9.3 - 17 Mar 2020 =
|
118 |
+
* Fixed : Capabilities screen was not accessible to non-Administrators who have "manage_capabilities" capability
|
119 |
+
* Fixed : Some functions were not accessible to network Super Administrators without a role on the site
|
120 |
+
* Change : Clarify some messages for plugin access denial
|
121 |
+
|
122 |
+
= 1.9.2 - 16 Mar 2020 =
|
123 |
+
* Feature : Auto-backup role and capabilities on each update (and on update to this version)
|
124 |
+
* Fixed : First-time installation: Capabilities menu item not displayed until after Plugins or Users menu clicked
|
125 |
+
* Change : Third Party Plugin Capabilities - always display checkboxes even if capabilities not present in Administrator role
|
126 |
+
* Fixed : Plugin capability sections - pp_set_notification_channel and pp_manage_roles were included in both PublishPress and PublishPress Permissions sections
|
127 |
+
* Fixed : Capability Negation (Denial) bulk unselect link was ambiguous due to missing strikethrough
|
128 |
+
|
129 |
+
= 1.9.1 - 16 Jan 2020 =
|
130 |
+
* Fixed : Create Role, Copy Role, and Add Capability sidebar functions did not work with ENTER keypress (caused screen reload without applying operation)
|
131 |
+
|
132 |
+
= 1.9 - 9 Jan 2020 =
|
133 |
+
* Change : Renamed to PublishPress Capabilities
|
134 |
+
* Feature : Capabilities link on PublishPress > Roles row opens Role Capabilities screen
|
135 |
+
* Feature : Role Capabilities screen links to PublishPress > Roles for member management
|
136 |
+
* Fixed : Browser reload caused Role Capabilities screen to display default role
|
137 |
+
* Fixed : Add Capability sidebar added custom capability to role immediately, but capability checkbox did not display as checked until reload
|
138 |
+
* Fixed : Category Assign or Delete capabilities were not effective due to WordPress core forcing default capability requirement
|
139 |
+
* Fixed : Term Assign or Delete capabilities were not effective due to WordPress core forcing default capability requirement
|
140 |
+
* Fixed : Multisite - On sub-sites, Role Capabilities screen did not display PublishPress Capabilities section to Super Administrators who don't have a role on the site
|
141 |
+
* Fixed : Role name captions on Role Capabilities and Backup Tool screens could not be translated
|
142 |
+
* Fixed : Checkbox bulk selection on Role Capabilities screen was incorrect under some conditions
|
143 |
+
* Change : Reinstate WordPress edit_published_posts workaround with correct status filtering behavior
|
144 |
+
* Change : Apply workaround filters for WordPress edit_published_posts / publish_posts handling only for users who have edit_published_posts capability for current post type
|
145 |
+
|
146 |
+
= 1.8.1 - 25 Oct 2019 =
|
147 |
+
* Fixed : Automatic publication of blank auto-drafts, WooCommerce posts save with incorrect post status (since 1.8)
|
148 |
+
|
149 |
+
= 1.8 - 24 Oct 2019 =
|
150 |
+
* Feature : WooCommerce, PublishPress, PressPermit capabilities grouped in sections on role editor screen
|
151 |
+
* Feature : Plugin API - plugins can hook into "cme_plugin_capabilities" filter to register their capabilities
|
152 |
+
* Feature : Work around WordPress issue preventing users with edit_published_posts (but not publish_posts) capability from updating published posts (https://core.trac.wordpress.org/ticket/47443)
|
153 |
+
* Feature : Work around WordPress issue allowing users with edit_published_posts (but not publish_posts) to unpublish published posts
|
154 |
+
* Fixed : If a unique edit/delete capability is already defined, don't change the definition
|
155 |
+
* Fixed : Removed add_users from the Core WordPress Capabilities section because it is was replaced by promote_users
|
156 |
+
* Fixed : PHP Notices on Role Capabilities screen for undefined index, under some configurations
|
157 |
+
* Fixed : HTML validation errors on Manage Capabilities screen
|
158 |
+
* Fixed : PHP 5.x : Notice for undefined constant PHP_INT_MIN on wp-admin Posts / Pages listing
|
159 |
+
* Change : Move Role Capabilities menu item to Permissions menu if PressPermit plugin is active (restoring previous behavior with Press Permit Core)
|
160 |
+
* Change : Edit Roles link in CME row of Plugins list
|
161 |
+
* Change : PublishPress icon, footer on Roles and Capabilities screen
|
162 |
+
|
163 |
+
= 1.7.5 - 24 May 2019 =
|
164 |
+
* Fixed : Users' inclusion or non-inclusion in Authors dropdown was not updated based on role edit
|
165 |
+
|
166 |
+
= 1.7.4 - 1 May 2019 =
|
167 |
+
* Fixed : On some sites, capabilities added dynamically by other code were forced into stored role definition (and could not be removed).
|
168 |
+
* Fixed : Negative role capabilities could not be directly unset (had to be checked, saved, then unchecked).
|
169 |
+
|
170 |
+
= 1.7.3 - 9 Apr 2019 =
|
171 |
+
* Fixed : Work around WP quirk of completely blocking admin page access for a post type if user lacks create capability for the post type and there are no other accessible items on the menu.
|
172 |
+
* Fixed : PHP Notices on Roles and Capabilities screen for non-Administrator with WooCommerce active
|
173 |
+
|
174 |
+
= 1.7.2 - 3 Apr 2019 =
|
175 |
+
* Compat : WooCommerce integration - Users lacking access to the "Add New Order" submenu could not access Posts, Pages, Products or any other Post Type listing. This occurred if "use create_posts" option enabled and user lacks the create capability for Orders.
|
176 |
+
|
177 |
+
= 1.7.1 - 29 Mar 2019 =
|
178 |
+
* Fixed : Press Permit integration - cannot load Permissions > Role Capabilities with Press Permit Core < 2.7
|
179 |
+
|
180 |
+
= 1.7 - 28 Mar 2019 =
|
181 |
+
* Feature : New right sidebar setting: "Type-Specific Capabilities" for selected post types (without activating Press Permit Core).
|
182 |
+
* Feature : New right sidebar setting: "Taxonomy-Specific Capabilities" ensures a distinct manage capability for selected taxonomies
|
183 |
+
* Feature : New right sidebar setting: "Detailed Taxonomy Capabilities" causes term assign, edit and deletion capabilities to be required and credited separate from management capability
|
184 |
+
* Feature : WooCommerce - Ensure orders can be edited or added based on edit_shop_orders / create_shop_orders capability
|
185 |
+
* Change : Lockout safeguard (preventing read capability removal) is bypassed if role has no WP admin / edit capabilities, or if it has "dashboard_lockout_ok" capability
|
186 |
+
* Compat : Press Permit: new plugin page slugs in Press Permit Core 2.7
|
187 |
+
|
188 |
+
= 1.6.1 =
|
189 |
+
* Feature : Prevent read capability from being removed from a standard role
|
190 |
+
* Feature : If read capability is missing from a standard role, display warning and instant fix link
|
191 |
+
* Feature : Additional save button at top of Roles and Capabilities screen!
|
192 |
+
* Change : Reinstate Press Permit description link
|
193 |
+
* Change : Thickbox popups for related plugins
|
194 |
+
|
195 |
+
= 1.6 =
|
196 |
+
* Feature : WooCommerce - If current user has duplicate_products capability, make Woo honor it
|
197 |
+
* Feature : Link to Backup Tool from sidebar of Roles and Capabilities screen
|
198 |
+
* Feature : Link to Roles and Capabilities screen from Backup Tool
|
199 |
+
* Change : Minor code cleanup and refactor
|
200 |
+
* Change : Copyrights, onscreen link for PublishPress ownership
|
201 |
+
* Change : Links to Related Permissions Plugins in sidebar on Roles and Capabilities screen
|
202 |
+
|
203 |
+
= 1.5.11 =
|
204 |
+
* Feature : Automatically save backup of WP roles on plugin activation or update
|
205 |
+
* Feature : When roles are manually backed up, also retain initial role backup
|
206 |
+
* Feature : Backup Tool can also display contents of role backups
|
207 |
+
|
208 |
+
= 1.5.10 =
|
209 |
+
* Fixed : Back button caused mismatching role dropdown selection
|
210 |
+
* Compat : PHP 7.2 - warning for deprecated function if a second copy of CME is activated
|
211 |
+
|
212 |
+
= 1.5.9 =
|
213 |
+
* Fixed : Potential vulnerability in wp-admin (but exposure was only to users with role editing capability)
|
214 |
+
|
215 |
+
= 1.5.8 =
|
216 |
+
* Fixed : PHP warning for deprecated function WP_Roles::reinit
|
217 |
+
* Change : Don't allow non-Administrator to edit Administrators, even if Administrator role level is set to 0
|
218 |
+
|
219 |
+
= 1.5.7 =
|
220 |
+
* Change : Revert menu captions to previous behavior ("Permissions > Role Capabilities" if Press Permit Core is active, otherwise "Users > Capabilities")
|
221 |
+
|
222 |
+
= 1.5.6 =
|
223 |
+
* Fixed : Correct some irregularities in CME admin menu item display
|
224 |
+
|
225 |
+
= 1.5.5 =
|
226 |
+
* Fixed : User editing was improperly blocked in some cases
|
227 |
+
|
228 |
+
= 1.5.4 =
|
229 |
+
* Fixed : Non-administrators' user editing capabilities were blocked if Press Permit Core was also active
|
230 |
+
* Fixed : Non-administrators could not edit other users with their role (define constant CME_LEGACY_USER_EDIT_FILTER to retain previous behavior)
|
231 |
+
* Fixed : Non-administrators could not assign their role to other users (define constant CME_LEGACY_USER_EDIT_FILTER to retain previous behavior)
|
232 |
+
* Lang : Changed text domain for language pack conformance
|
233 |
+
|
234 |
+
= 1.5.3 =
|
235 |
+
* Fixed : On single-site installations, non-Administrators with delete_users capability could give new users an Administrator role (since 1.5.2)
|
236 |
+
* Fixed : Deletion of a third party plugin role could cause users to be demoted to Subscriber inappropriately
|
237 |
+
* Compat : Press Permit Core - Permission Group refresh was not triggered if Press Permit Core is inactive when CME deletes a role definition
|
238 |
+
* Compat : Support third party display of available capabilities via capsman_get_capabilities or members_get_capabilities filter
|
239 |
+
* Change : If user_level of Administrator role was cleared, non-Administrators with user editing capabilities could create/edit/delete Administrators. Administrator role is now implicitly treated as level 10.
|
240 |
+
* Fixed : CSS caused formatting issues around wp-admin Update button on some installations
|
241 |
+
* Perf : Don't output wp-admin CSS on non-CME screens
|
242 |
+
* Lang : Fixed erroneous text_domain argument for numerous strings
|
243 |
+
* Lang : Updated .pot and .po files
|
244 |
+
|
245 |
+
= 1.5.2 =
|
246 |
+
* Fixed : Network Super Administrators without an Administrator role on a particular site could not assign an Administrator role to other users of that site
|
247 |
+
|
248 |
+
= 1.5.1 =
|
249 |
+
* Fixed : Non-administrators with user editing capabilities could give new users a role with a higher level than their own (including Administrator)
|
250 |
+
|
251 |
+
= 1.5 =
|
252 |
+
* Feature : Support negative capabilities (storage to wp_roles array with false value)
|
253 |
+
* Feature : Multisite - Copy a role definition to all current sites on a network
|
254 |
+
* Feature : Multisite - Copy a role definition to new (future) sites on a network
|
255 |
+
* Feature : Backup / Restore tool requires "restore_roles" capability or super admin status
|
256 |
+
* Fixed : Role reset to WP defaults did not work, caused a PHP error / white screen
|
257 |
+
* Change : Clarified English captions on Backup Tool screen
|
258 |
+
* Fixed : Term deletion capability was not included in taxonomies grid even if defined
|
259 |
+
* Fixed : jQuery notices for deprecated methods on Edit Role screen
|
260 |
+
* Compat : Press Permit - if a role is marked as hidden, also default it for use by PP Pro as a Pattern Role (when PP Collaborative Editing is activated and Advanced Settings enabled)
|
261 |
+
* Change : Press Permit promotional message includes link to display further info
|
262 |
+
|
263 |
+
= 1.4.10 =
|
264 |
+
* Perf : Eliminated unused framework code (reduced typical wp-admin memory usage by 0.6 MB)
|
265 |
+
* Fixed : Failure to save capability changes, on some versions of PHP
|
266 |
+
* Compat : Press Permit - PHP Warning on role save
|
267 |
+
* Compat : Press Permit - PHP Warning on "Force Type-Specific Capabilities" settings update
|
268 |
+
* Compat : Press Permit - "supplemental only" option stored redundant entries
|
269 |
+
* Compat : Press Permit - green background around capabilities which
|
270 |
+
* Compat : Press Permit - PHP Warning on "Force Type-Specific Capabilities" settings update
|
271 |
+
* Maint : Stop using $GLOBALS superglobal
|
272 |
+
* Change : Reduced download size by moving screenshots to assets folder of project folder
|
273 |
+
|
274 |
+
= 1.4.9 =
|
275 |
+
* Fixed : Role capabilities were not updated / refreshed properly on multisite installations
|
276 |
+
* Feature : If create_posts capabilities are defined, organize checkboxes into a column alongside edit_posts
|
277 |
+
* Feature : "Use create_posts capability" checkbox in sidebar auto-defines create_posts capabilities (requires Press Permit)
|
278 |
+
* Compat : bbPress + Press Permit - Modified bbPress role capabilities were not redisplayed following save, required reload
|
279 |
+
* Compat : bbPress + Press Permit - Adding a capability via the "Add Cap" textbox caused the checkbox to be available but not selected
|
280 |
+
* Compat : Press Permit - "supplemental only" option was always enabled for newly created and copied roles, regardless of checkbox setting near Create/Copy button
|
281 |
+
|
282 |
+
= 1.4.8 =
|
283 |
+
* Compat : bbPress + Press Permit - "Add Capability" form failed when used on a bbPress role, caused creation of an invalid role
|
284 |
+
|
285 |
+
= 1.4.7 =
|
286 |
+
* Compat : Press Permit - flagging of roles as "supplemental assignment only" was not saved
|
287 |
+
|
288 |
+
= 1.4.6 =
|
289 |
+
* Compat : bbPress 2.2 (supports customization of dynamic forum role capabilities)
|
290 |
+
* Compat : Press Permit + bbPress - customized role capabilities were not properly maintained on bbPress activation / deactivation, in some scenarios
|
291 |
+
* Fixed : Role update and copy failed if currently stored capability array is corrupted
|
292 |
+
|
293 |
+
= 1.4.5 =
|
294 |
+
* Fixed : Capabilities were needlessly re-saved on role load
|
295 |
+
* Fixed : Capability labels in "Other WordPress" section did not toggle checkbox selection
|
296 |
+
* Press Permit integration: If capability is granted by the role's Permit Group, highlight it as green with a descriptive caption title, but leave checkbox enabled for display/editing of role defintion setting (previous behavior caused capability to be stripped out of WP role definition under some PP configurations)
|
297 |
+
|
298 |
+
= 1.4.4 =
|
299 |
+
* Fixed : On translated sites, roles could not be edited
|
300 |
+
* Fixed : Menu item change to "Role Capabilities" broke existing translations
|
301 |
+
|
302 |
+
= 1.4.3 =
|
303 |
+
* Fixed : Separate checkbox was displayed for cap->edit_published_posts even if it was defined to the be same as cap->edit_posts
|
304 |
+
* Press Permit integration: automatically store a backup copy of each role's last saved capability set so they can be reinstated if necessary (currently for bbPress)
|
305 |
+
|
306 |
+
= 1.4.2 =
|
307 |
+
* Language: updated .pot file
|
308 |
+
* Press Permit integration: roles can be marked for supplemental assignment only (and suppressed from WP role assignment dropdown, requires PP 1.0-beta1.4)
|
309 |
+
|
310 |
+
= 1.4.1 =
|
311 |
+
* https compatibility: use content_url(), plugins_url()
|
312 |
+
* Press Permit integration: if role definitions are reset to WP defaults, also repopulate PP capabilities (pp_manage_settings, etc.)
|
313 |
+
|
314 |
+
= 1.4 =
|
315 |
+
* Organized capabilities UI by post type and operation
|
316 |
+
* Editing UI separates WP core capabilities and 3rd party capabilities
|
317 |
+
* Clarified sidebar captions
|
318 |
+
* Don't allow a non-Administrator to add or remove a capability they don't have
|
319 |
+
* Fixed : PHP Warnings for unchecked capabilities
|
320 |
+
* Press Permit integration: externally (dis)enable Post Types, Taxonomies for PP filtering (which forces type-specific capability definitions)
|
321 |
+
* Show capabilities which Press Permit adds to the role by supplemental type-specific role assignment
|
322 |
+
* Reduce memory usage by loading framework and plugin code only when needed
|
323 |
+
|
324 |
+
= 1.3.2 =
|
325 |
+
* Added Swedish translation.
|
326 |
+
|
327 |
+
= 1.3.1 =
|
328 |
+
* Fixed a bug where administrators could not create or manage other administrators.
|
329 |
+
|
330 |
+
= 1.3 =
|
331 |
+
* Cannot edit users with more capabilities than current user.
|
332 |
+
* Cannot assign to users a role with more capabilities than current user.
|
333 |
+
* Solved an incompatibility with Chameleon theme.
|
334 |
+
* Migrated to the new Alkivia Framework.
|
335 |
+
* Changed license to GPL version 2.
|
336 |
+
|
337 |
+
= 1.2.5 =
|
338 |
+
* Tested up to WP 2.9.1.
|
339 |
+
|
340 |
+
= 1.2.4 =
|
341 |
+
* Added Italian translation.
|
342 |
+
|
343 |
+
= 1.2.3 =
|
344 |
+
* Added German and Belorussian translations.
|
345 |
+
|
346 |
+
= 1.2.2 =
|
347 |
+
* Added Russian translation.
|
348 |
+
|
349 |
+
= 1.2.1 =
|
350 |
+
* Coding Standards.
|
351 |
+
* Corrected internal links.
|
352 |
+
* Updated Framework.
|
353 |
+
|
354 |
+
= 1.2 =
|
355 |
+
* Added backup/restore tool.
|
356 |
+
|
357 |
+
= 1.1 =
|
358 |
+
* Role deletion added.
|
359 |
+
|
360 |
+
= 1.0.1 =
|
361 |
+
* Some code improvements.
|
362 |
+
* Updated Alkivia Framework.
|
363 |
+
|
364 |
+
= 1.0 =
|
365 |
+
* First public version.
|