• Resolved negapo

    (@negapo)


    Hi, we have several custom user roles for different type of privileges, and we wanted to enforce 2FA on more than the two configured roles: “editor” and “administrator”. Could you please create a filter on the plug-in so we can extend or remove roles? A filter that we can alter the $roles at get_admin_user_roles() in sg-security/core/Helper/User_Roles_Trait.php so we don’t have to hardcode it and lose it in every update. Thanks

    • This topic was modified 2 years, 1 month ago by negapo.
Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter negapo

    (@negapo)

    Sorry, there is already a filter: “sg_security_2fa_roles”

    I didn’t read the code to the end

    Thread Starter negapo

    (@negapo)

    For anyone who finds it usefull:

    
    function sg_security_add_roles( $roles ) {
        $roles[] = 'role_id_name';
        return $roles;
    }
    add_filter( "sg_security_2fa_roles", "sg_security_add_roles");

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Filter for additional user Roles.’ is closed to new replies.