• Resolved walilkoa

    (@walilkoa)


    Firstly, this plugin is fantastic! It has checked of 95% of the boxes for what we were looking for on user sync with another system.

    There is only one sticking point we are trying to figure out; there are certain roles, such as Board Member, or GiveWP Accountant, and the like, which should NOT be affected by imports. Otherwise, we would like the Member and Expired roles to be interchanged based on presence of the user in the CSV. ‘Member’ is the default role checked for import.

    Regarding “update roles for existing users”: We DO want roles to be upgraded from Expired to Member if a user is present in the CSV and is also on the site as Expired, so “no” does not fit. We don’t want to lose higher roles like Board Member when there has been no change to the user in the CSV, so “update and override” also does not fit. Finally, users should only be Member or Expired, not both, so “add new roles” also does not work.

    Update and override would be the best option, if there were certain roles in addition to Administrator that could be protected from the plugin. Is there anywhere we can adjust the roles that are avoided when the plugin executes role changes on import?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Javier Carazo

    (@carazo)

    Good morning @walilkoa,

    Maybe a filter here would be useful for you?

    if( !( in_array("administrator", $acui_helper->get_roles_by_user_id( $user_id ), FALSE) || is_multisite() && is_super_admin( $user_id ) )){

    A filter that applies to administrator in order to include there more roles.

    Thread Starter walilkoa

    (@walilkoa)

    That was a great start, thank you! I ended up with something like this:

    
    $protected_roles = array('administrator','board_member','give_manager','give_accountant','give_donor');
    
    if( !(count(array_intersect($protected_roles, $acui_helper->get_roles_by_user_id( $user_id ))) == 0 || is_multisite() && is_super_admin( $user_id ) )){
    
    • This reply was modified 2 years, 9 months ago by walilkoa.
    • This reply was modified 2 years, 9 months ago by walilkoa.
    Thread Starter walilkoa

    (@walilkoa)

    i completely misunderstood the function of what i replaced, needed a > instead of == for future reference.

    Plugin Author Javier Carazo

    (@carazo)

    Sorry I do not understand what are you referring to.

    I told you about a hook.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Role protection’ is closed to new replies.