Tagged: advanced layout builder, user roles
-
AuthorPosts
-
September 21, 2017 at 3:10 pm #854896
Hello the title pretty much says it all.
I want userrole editor to be able to edit layout content as well as administrators even though I´ve checked “Lock advanced layout builder” in Enfold settings.
I have added user role editor in hopes of fixing it, but can not find anything like that there.
September 22, 2017 at 10:36 pm #855619Hey snitt,
Where have you added the user role, can u define please?
Best regards,
BasilisSeptember 25, 2017 at 12:50 pm #856461Page is listet with login info in private content.
Userrole is added in wordpress as editor with som extra modifications though the plugin User role editor. And I want him/her to be able to edit avia layout builder as well.September 26, 2017 at 8:57 pm #857139Hi,
It seems that how we load Avia Editor, has some parametres on that regarding editing.
Please do leave the access open, so we cantake some more time on it.Thank you
Best regards,
BasilisSeptember 27, 2017 at 9:09 am #857381Thanks for looking into this. I will leave access open. It need to be fixed by thursday, is this possible? If its not in order by then I´ll have to give client administrator role and edit that role to be limited.
- This reply was modified 7 years ago by snitt.
September 29, 2017 at 9:11 am #858356Hi,
Thank you for waiting. Please add this code in the functions.php file.
remove_filter('avf_allow_drag_drop', 'avia_disable_alb_drag_drop', 30, 1); function avia_disable_alb_drag_drop_mod( $disable ) { $user = wp_get_current_user(); $allowed_roles = array('editor', 'administrator', 'author'); if( array_intersect($allowed_roles, $user->roles ) || avia_get_option('lock_alb_for_admins', 'disabled') != "disabled") { $disable = avia_get_option('lock_alb', 'disabled') != "disabled" ? true : false; } return $disable; } add_filter('avf_allow_drag_drop', 'avia_disable_alb_drag_drop_mod', 30, 1);
Best regards,
IsmaelSeptember 29, 2017 at 11:57 am #858445Added this, but it does not work.
Editor can not edit avia layout builder If I use it with “Lock advanced layout builder” checked.
All users can edit avia layout builder with “Lock advanced layout builder” checked and code pased in function.php.
So same as before. Did this work for you?
September 30, 2017 at 7:13 am #858672Hi,
Thank you for the update.
Please replace the filter with the following.
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; }
Best regards,
IsmaelSeptember 4, 2020 at 11:07 am #1243273That Last answer works for me! Thanks!
September 4, 2020 at 2:14 pm #1243359Hi victormontesdeoca,
Glad you got it working for you! :)
If you need further assistance please let us know.
Best regards,
VictoriaJanuary 28, 2021 at 11:08 am #1276030Hey dear Enfold-Support-Team-Members, I used the code Isamel provided (2017-09-30) in serveral installations. Worked like charm! Right now there seems to be a problem. In latest WP and latest Enfold the
function avia_disable_alb_drag_drop_mod
is not working anymore. If the complete code is added the advanced builder is active for all user roles, not only for'editor', 'administrator', 'author'
. Could you take a look into the part of the function that is checking the roles? I would need a helping hand to sort it out. At some of my pages it is now possible to access the advanced layout builder for roles that should not be able to drag and drop. Thank you! (answers in English or German please – thanks)January 29, 2021 at 4:45 am #1276219Hi,
Thank you for the update.
What happens when you remove this line from the snippet above?
remove_filter('avf_allow_drag_drop', 'avia_disable_alb_drag_drop', 30, 1);
Best regards,
IsmaelFebruary 1, 2021 at 6:15 pm #1276891Hey Ismael,
thank you for your fast answer. I removed the line and it does the trick!
Happy customer with more than 30 installations of your theme and now my first support question with correct answer in no time at all – thank you!February 2, 2021 at 11:12 am #1277066 -
AuthorPosts
- The topic ‘Unlock "Lock advanced layout builder" for editor’ is closed to new replies.