Viewing 14 posts - 1 through 14 (of 14 total)
  • Author
    Posts
  • #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.

    #855619

    Hey snitt,

    Where have you added the user role, can u define please?

    Best regards,
    Basilis

    #856461

    Page 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.

    #857139

    Hi,

    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,
    Basilis

    #857381

    Thanks 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.
    #858356

    Hi,

    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,
    Ismael

    #858445

    Added 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?

    #858672

    Hi,

    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,
    Ismael

    #1243273

    That Last answer works for me! Thanks!

    #1243359

    Hi victormontesdeoca,

    Glad you got it working for you! :)

    If you need further assistance please let us know.

    Best regards,
    Victoria

    #1276030

    Hey 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)

    #1276219

    Hi,

    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,
    Ismael

    #1276891

    Hey 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!

    #1277066

    Hi,

    Great! Glad it worked! Thank you for your support and for using the theme. Please do not hesitate to open a new thread if you need anything else.

    Have a nice day.

    Best regards,
    Ismael

Viewing 14 posts - 1 through 14 (of 14 total)
  • The topic ‘Unlock "Lock advanced layout builder" for editor’ is closed to new replies.