Forum Replies Created
-
AuthorPosts
-
Vladimir
KeymasterHi,
It’s not possible inside URE Pro. You have to use PHP code to make this update. Like this:
add_action('admin_init', 'ure_content_view_add_role'); function ure_content_view_add_role() { global $wpdb; $key = URE_Content_View_Restrictions::content_for_roles; $query = "SELECT meta_id FROM {$wpdb->postmeta} WHERE meta_key='{$key}' AND meta_value='level1'"; $list = $wpdb->get_col($query); if (empty($list)) { return; } foreach ($list as $meta_id) { $query = "UPDATE {$wpdb->postmeta} SET meta_value='level1, level2' WHERE meta_id={$meta_id} LIMIT 1"; $wpdb->query($query); } }This code takes all posts and pages for which content view access roles set to ‘level1’ and replaces ‘level1’ with the list of roles: ‘level1, level2’.
1. Create a fresh database backup
2. Place this code as a separate .php file into wp-content/mu-plugin/ folder as a Must Use plugin.
3. Open any page under yoursite/wp-admin
4. Remove this .php file from wp-content/mu-plugin/ folder.
5. Check the results.Code will be more complex if you need to make changes for the pages only and do not touch any posts which can have the same role in view permissions.
06/02/2018 at 03:01 in reply to: Network Admin page error, due to ET_BUILDER_DIR in fake_divi_post_type_load() #4584Vladimir
KeymasterHi,
Thanks for this report.
Yes, this piece of code is needed to provide access to custom post type ‘et_pb_layout’ user capabilities at User Role Editor page when we force it to use own capabilities (‘edit_et_pb_layouts’, etc.) instead of ‘post’ like.
It seems that it stopped working after of some Divi theme update. I changed line
require ET_BUILDER_DIR . ‘layouts.php’;to
et_builder_register_layouts();This change will be available with upcoming version 4.41
Vladimir
KeymasterThanks for letting me know.
Vladimir
KeymasterHi Aldo,
Edit restrictions add-on support hierarchy for the WordPress built-in pages only. It applies edit restrictions from the parent page to all child pages by default.
I did not meet with usage hierarchical CPT until this moment.
A possible workaround – use categories as working groups. User restricted by category can post to that category only. A problem – parent post will not be assigned automatically.
URE Pro does not restrict parent posts available to a user.It seems that URE Pro is not ready for hierarchical scheme realized by you.
May be you will think about work with this CPT without hierarchy, separating access to the items inside this CPT just by categories?
Vladimir
KeymasterCan you share Beaver Builder Pro copy for testing?
Vladimir
KeymasterHi,
This feature is not realized yet. Thanks for adding +1 to a quantity of clients who desire this option. It will do it with the next update.
Vladimir
KeymasterDeveloper who added custom post types at your site registered theme with user capabilities default for the WordPress built-in posts, but protected admin menu items by ‘edit_pages’ capability.
I used “Admin menu access” add-on to get this information: https://www.role-editor.com/block-admin-menu-itemsThen I added ‘edit_pages’ capability to the ‘Speaker’ role and blocked unneded menu items with the same “Admin menu” button.
Tests showed that while custom post types are defined with default ‘post’ capability type, they require really capabilities from the ‘pages’ group. So I added them to the ‘Speaker” role.
Vladimir
KeymasterYou can send URL and admin credentials to support [at-sign] role-editor.com
To what custom post type do you wish to provide access and to what role?Vladimir
KeymasterHi,
Do you use “Admin menu access” add-on from User Role Editor Pro and blocked some menu items for this role?
A lot of User Role Editor Pro users work with AVADA theme and do not report any problem.
In general if you just added a capability to a role, the rest work makes WordPress itself and theme and/or plugins which check user role and capabilities. So if a problem is raised really for this reason you can ask support question to fusion-builder plugin developers too.
I can investigate the issue in my test environment if you provide me access to the database and site files copy – via DropBox or GoogleDrive (support [at-sign] role-editor.com)
Vladimir
KeymasterTry to turn of the “Activate user access management to editing selected posts, pages, custom post types” checkbox at the “Settings->User Role Editor->Additional->Modules” page under “Content editing restrictions”. If that will resolve the issue, you have additional restrictions for this user or his role(s).
In case you need that I look on the issue at your site you can send URL and admin credentials to support [at-sign] role-editor.com
Vladimir
KeymasterAre these notices still in place if you deactivate User Role Editor?
It seems that this issue is more related to the fusion-builder plugin.Vladimir
KeymasterI got the file and isolated the issue. The error message is returned for the ‘1’ capability.
There is a strict type checking at the URE code:if ($key!==$sanitized_key) {But $key contains an integer 1, but $sanitized_key contains string ‘1’. So check is failed and returns error.
I see ‘1’ capability from time to time at different client sites, but still did not have information what plugin can add it. Try to revoke it from all roles to which it is granted. Then delete this capability as unused. Export roles again. This problem with import should gone away.
Thanks for pointing me on this issue. I will enhance a code here.
Vladimir
KeymasterSend exported .dat file which you can not import to support [at-sign] role-editor.com
I will test it and try to understand what is going wrong.Vladimir
KeymasterWhen you can not revoke some user capability from a role, you can block unneeded admin menu items, with “Admin menu access” add-on.
Vladimir
KeymasterAlphanumeric characters, dashes, underscores, spaces and slashes are allowed by default in user capability ID by default. This PHP regular expression is used: /[^a-zA-Z0-9_\-\s\/]/
Look if you have capability with 1 inside but containing not allowed characters. Let me know what it is.
I work on the export/import procedure upgrade. I will add the same filter to the export code in order do not generate this error if some existing capability does not go via this check.
-
AuthorPosts