-
AuthorPosts
-
April 8, 2021 at 3:09 pm #1293281
Hi @yigit
we need to allow a certain employee to edit pages.
So we enabled “User Role Editor” gave the employee a new role and granted rights to edit pages – but the ALB does not load for that certain person.How can we make the ALB working with URE?
Max
Screens:
https://digital-print-group.de/screenshots/alb.jpg
https://digital-print-group.de/screenshots/role.jpgApril 12, 2021 at 5:07 am #1293830Hey digitalprint2222,
Thank you for the inquiry.
You can use this snippet in the functions.php file to unlock the advance layout builder for different user roles other than the administrator.
function ava_enable_alb_for_editor() { remove_filter('avf_allow_drag_drop', 'avia_disable_alb_drag_drop', 30, 1); add_filter('avf_allow_drag_drop', 'avia_disable_alb_drag_drop_mod', 40, 1); } add_action('init', 'ava_enable_alb_for_editor'); function avia_disable_alb_drag_drop_mod( $disable ) { $user = wp_get_current_user(); $allowed_roles = array('editor', 'administrator', 'author'); $check = array_intersect( $allowed_roles, $user->roles ); if( ! empty( $check ) ) { $disable = avia_get_option('lock_alb', 'disabled') != "lock_alb" ? true : false; } return $disable; }
You can add more user roles in this array.
$allowed_roles = array('editor', 'administrator', 'author');
Best regards,
IsmaelApril 14, 2021 at 7:02 pm #1294428Hi &thanks, but it does not work
It works for the standard roles, but not for the role we have created.
I gave it a new try and choosed this way:
1: created a new role with a new name & new ID …and copied the rights from editor
2: Than it worked but it had to many rights
3: I narrowed the rights down and i realized that i have to allow this which is very strange since it is about contactforms:
https://digital-print-group.de/screenshots/role2.jpg
4: If i grant this right the user can edit the forms (CF7) which we dont want toAnd, strange also, i did not need to add the role into the array.
Why?How can i make the ALB work without granting the role so many rights beside editing pages?
Kind regards Max
April 19, 2021 at 4:21 am #1295059Hi,
By default, only users that can “switch_themes” or a user that has that capability, usually an admin, are allowed to edit the page.
Does it work correctly when the User Role Editor plugin is disabled? We are not really sure how the plugin affects the user roles, so additional help from the plugin developers might be required.
Best regards,
IsmaelApril 19, 2021 at 1:11 pm #1295273“only users that can “switch_themes” or a user that has that capability, usually an admin, are allowed to edit the page. ”
1: This is proofable not true for pages. It might be true for ALB but then it it is a bad thing (see #2).
2: If it were true it makes no sense since you dont want to give (for example) a newsmagazine editor the capability of foobaring your whole website.Result: If i disable URE the forms have a lower restriction cause i am allowed to edit them even if i am not allowed to edit pages.
What now?Max
April 21, 2021 at 6:44 am #1295688Hi,
1: This is proofable not true for pages. It might be true for ALB but then it it is a bad thing (see #2).
By “edit the pages”, I meant “edit the page using the ALB”. I thought that was implied since we are discussing user roles or permissions for the advance layout builder.
Did you activate the Layout Builder > Lock advanced layout builder option?
This removes the ability to move or delete existing template builder elements, or add new ones, for everyone who is not an administrator. The content of an existing element can still be changed by everyone who can edit that entry.
What happens when you use a default editor account?
Related thread: https://kriesi.at/support/topic/unlock-lock-advanced-layout-builder-for-editor/#post-858672
Best regards,
IsmaelApril 21, 2021 at 10:32 am #1295748Hi,
i already knew about the thread you linked and the lock is not active.(I checked that before asking you.)“What happens when you use a default editor account? ”
URE not active:
Can edit, create & delete pages, posts, portfolios & forms (CF7)URE active with user as editor:
Same as aboveURE active with user as DPG-role:
Can not edit posts
Can create all posttypes
Can edit pages with ALB
BUT – again – can also edit forms (which we dont want)Max
April 23, 2021 at 4:21 am #1296167Hi,
What is the actual name or slug of the user role that you created in URE? Try to lock the ALB in the Theme Options, then add the user role name or slug in the array.
$allowed_roles = array('editor', 'administrator', 'author');
Best regards,
IsmaelApril 25, 2021 at 8:45 pm #1296629It didnt change anything
1: Even if i leave the ALB locked the user can do everything i already desribed in my last post
2: When i unlock…..same situationMax
April 27, 2021 at 5:33 am #1296883Hi,
Thank you for following up.
Can we access the site? Please post the WordPress and FTP details in the private field, and disable the cache and minification plugins temporarily.
Best regards,
IsmaelApril 29, 2021 at 12:52 pm #1297330No, but you can access the staging (its a clone) but you need to activate URE on your own since the clone shows the state from 2 weeks ago.
But before:
The code you gave me leads to the fact that :
– you cant switch from ALB mode to another mode
– you cant use ALB when creating a new pageWhy: The ALB-Buttos is gone
And this happens also when URE is enabled and disabled – so it must be your code.
You can see what i mean on the video i provided in the private fieldMax
April 30, 2021 at 12:41 pm #1297535Hi,
Alright. Please post the account info (WP and FTP) of the staging site in the private field. For additional info or assistance, try to contact the authors of the URE plugin.
Thank you for your patience.
Best regards,
IsmaelMay 5, 2021 at 1:01 pm #1298535Hi,
credentials in private field.kind regards
MaxMay 7, 2021 at 9:23 am #1298881Hi,
Thank you for the info.
The URE plugin is not available when we checked the site, so we installed it and created a new user with the editor role. We do not know the actual configuration of the user role that you previously created, so we used the default editor role from the plugin. We then logged in using the new user account, and was able to create a page using the advance layout builder. (see private field)
Best regards,
IsmaelMay 7, 2021 at 1:52 pm #1298954Hi Ismael,
yes, but as you see – the problem is not solved.Problem: User can edit forms
Task: User should be able to edit pages with ALB but not edit formsKind regards
MaxMay 10, 2021 at 6:10 am #1299257Hi,
Unfortunately, we do not know what permissions the user role should or should not have in order to edit the contact form. You may need to contact the plugin developer for that.
You can also check this documentation to control access to the forms.
// https://contactform7.com/restricting-access-to-the-administration-panel/
According to it, Contact Form 7 allows all users except subscriber users to have access to the administration panel; but allows only administrator and editor users to edit contact forms. This is why the editor user role that we created above can still access the form. To work around that, try to declare the constants from the documentation to only allow access to user roles that can manage_options.
define( 'WPCF7_ADMIN_READ_CAPABILITY', 'manage_options' ); define( 'WPCF7_ADMIN_READ_WRITE_CAPABILITY', 'manage_options'
Best regards,
Ismael -
AuthorPosts
- You must be logged in to reply to this topic.