• Resolved june01

    (@june01)


    Hi,
    I have a multisite installation and only super admins are able to approve new users. I can’t make them superadmin just for this purpose. How can I make a custom user role for this?

Viewing 15 replies - 1 through 15 (of 16 total)
  • Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @june01

    Have you tried approving users when you visit their profile? See the gear icon and then click on the “Approve Membership”. The user that will approve a membership should have the permission “Can edit other member accounts?” in the UM User Role settings.

    Regards,

    Thread Starter june01

    (@june01)

    I’ve created a new user role called User Manager. This user should be able to manage subscribers only which includes approve/reject/delete/edit and view. I’ve set all required permissions in UM User Role settings but still not working. I can’t manage the users and view them.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @june01

    Are you trying to approve the user via /user/ page or WP Admin > Users?

    Regards,

    Thread Starter june01

    (@june01)

    I want to approve users using the member directory in front end.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @june01

    How many roles are assigned to your test account? Could you please provide a screenshot of the User Role( User Manager ) Settings? Please go to WP Admin > Ultimate Member > User Role > Edit “User Manager” role. You can upload the screenshot via imgur.com and then share the image URL here so we can review it.

    Regards,

    Thread Starter june01

    (@june01)

    Only one user is assigned the role User Manager. but I’ll probably will need more.
    This is the link to the screenshots.

    Thread Starter june01

    (@june01)

    Hi, is there any update regarding this issue? The only way to make them able to approve users is to give them superadmin permissions. Only site admin is not enough. And I can’t do that. I only want them to access subscribers and not the whole network.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @june01

    Users with edit_users capability can approve/delete users. Have you tried checking this capability in the User Role settings?

    Regards,

    Thread Starter june01

    (@june01)

    Yeah, I’ve tried this but same issue. They only can approve users when I give them the permission to manage users in whole network: manage_network_users

    Thread Starter june01

    (@june01)

    Hi, is there no update on this?

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @june01

    Could you please confirm that you’re trying to approve an account via UM Profile Form? Please see: https://drive.google.com/file/d/105AchcVXu4NRvbsOn-QDGj8HsuLAWw8B/view?usp=sharing

    This is the code that edit_users is used for account approval:
    https://github.com/ultimatemember/ultimatemember/blob/master/includes/core/um-actions-core.php#L38

    There are no manage_network_users in the validation so I’m wondering why it works for you.

    Regards,

    Thread Starter june01

    (@june01)

    without the permission “manage_network_users” I am not able to view/edit user profiles that have not been approved.
    And in Member Directory page only edit and delete options are displayed. Edit does not work, just like view profile, I’ll be redirected to home.
    As you can see in this screenshot.

    Maybe because I have multisite installation, that’s why it’s a bit different?

    • This reply was modified 3 years ago by june01.
    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @june01

    Could you please try running the following code snippet? You can add it to your theme/child-theme’s functions.php file or use the Code Snippet plugin to run the code.

    function edit_shop_manager() {
        // Get custom role
        $user_manager = get_role('user_manager');
        $user_manager->add_cap('edit_users');
    }
    add_action( 'init', 'edit_shop_manager' );

    Let’s see if you can edit/approve users when running the above code.

    Regards,

    Thread Starter june01

    (@june01)

    added this code to Code Snippets but same issue. I still can’t edit or approve new subscribers.

    Plugin Contributor Champ Camba

    (@champsupertramp)

    Hi @june01

    Please try this one:

    add_filter("map_meta_cap","um_100921_user_cap", 10, 4);
    function um_100921_user_cap( $caps, $cap, $user_id, $args ){
    	 um_fetch_user( $user_id );
    	 if( um_user("role") == "user_manager" ){
    	   unset( $caps[0] );
    	   $caps[ ] = "edit_users";
    	 }
    	
    	return $caps;
    }

    Regards,

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Custom User Role to approve user’ is closed to new replies.