I'm trying to limit what pages and Menu items different

Hi Guys,

I'm trying to limit what pages and Menu items different user roles can see on a property management site (using WP Property & premium addons).

This plugin uses custom user roles to limit what users can do, and I would like to use the features Membership 2 Pro give in the user registration process (specifically send email when promoted to a particular user role/restrict access to "add property" page).

As such - is there anyway to associate a user role with membership level? Currently on registration, the user is assigned a particular role (Property Agent Applicant). I would like that members of that particular role they are automatically added to the membership level in Membership pro. Likewise, when they are approved as agents and the role is changed (within 3rd party plugin) that the membership level is changed accordingly.

Many thnaks,

Emlyn

  • Luís

    Hi @Emlyn,

    I hope had been good today!

    Yes you can protect your menu items and define what levels can see that.

    Go to Membership 2 -> Protection Rules. Then select Menu "Items" and define here your protection rules.

    As such - is there anyway to associate a user role with membership level?

    You can try use the "Member Capabilities" add-on.

    Go to Go to Membership 2 -> Add-ons and enable "Member Capabilities".

    Then, go to Membership 2 -> Protection Rules and select "User Roles".

    This add-on don't change the native Wordpress user roles, but allows members of a particular Membership has the capability of the role defined for this Membership.

    E.g.

    If you give to the "Membership level 1" the role "Author", when you add a user he will remain a "Subscriber" but will have the capability to add pages, edit, etc.. (the native role "Subscriber" does not allow to do that).

    To use this feature, users will need to register through the Membership 2 Pro registration form.

    Likewise, when they are approved as agents and the role is changed (within 3rd party plugin) that the membership level is changed accordingly

    In the same line, when you change the membership level of an user, this will change your capabilities, but not vice versa.

    I hope this information has been helpful. If I can help you in this or other questions, please let
    me know!

    Cheers, Luís

  • Emlyn

    Hi Luís,

    Thanks for your reply.

    Yes you can protect your menu items and define what levels can see that.

    Go to Membership 2 -> Protection Rules. Then select Menu "Items" and define here your protection rules.

    As such - is there anyway to associate a user role with membership level?
    You can try use the "Member Capabilities" add-on.

    Thanks for this - this is the main reason I decided to use this plugin.

    This add-on don't change the native Wordpress user roles, but allows members of a particular Membership has the capability of the role defined for this Membership.

    E.g.

    If you give to the "Membership level 1" the role "Author", when you add a user he will remain a "Subscriber" but will have the capability to add pages, edit, etc.. (the native role "Subscriber" does not allow to do that).

    Thanks - this is unfortunately not what I was hoping for - I was hoping the inverse to be true (user roles inherit membership, not membership inherit role).

    However, a workaround could be - User registers using separate registration (assigned role of "landlord"). As default no one can see the menu items "Add Property" until they are a member of the "Landlords - Approved Group". The approval process would be to add them to that group. As such the user have the privileges required to add properties, but are limited by the lack of access to the relevant pages.

    In your opinion, does this contravene best practice and is it workable do you think?

    Many thanks!

    Emlyn

  • Emlyn

    An additional question - is there any way to add users to membership via the front end?
    If there isn't an out of the box method, I wouldn't be avers to custom coding (e.g. shortcode listing all "users with applicant role" and are not in the "approved membership", with a button next to each member that will add them to the group on click.

    Is this feasible - and do you have any pointers :smiley:?

    E

  • Luís

    Hi @Emlyn,

    I hope had been good today!

    However, a workaround could be - User registers using separate registration (assigned role of "landlord"). As default no one can see the menu items "Add Property" until they are a member of the "Landlords - Approved Group". The approval process would be to add them to that group. As such the user have the privileges required to add properties, but are limited by the lack of access to the relevant pages.

    Try create a "Default Membership" to all users, and define here what content is available to all logged-in users that did not join any other Membership yet.

    In Protection Rules ->User Roles, give to this members the role "landlord".

    Then create a membership "Landlords - Approved Group" as "Standard Membership" and give to these members the capabilities to add properties, etc..

    When you approve a member, change him to the "Landlords - Approved Group" membership.

    An additional question - is there any way to add users to membership via the front end?
    If there isn't an out of the box method, I wouldn't be avers to custom coding (e.g. shortcode listing all "users with applicant role" and are not in the "approved membership", with a button next to each member that will add them to the group on click.

    Unfortunately this request is not easy so I can give you any pointers.

    I've just moved this over to our Features and Feedback, so it can be taken into consideration for the next plugin updates. Hopefully some other members will show their support for the feature too, the more members that ask for it the sooner it will happen.

    Meantime you can try our jobs board, in order to find a developer that can help you:

    https://premium.wpmudev.org/wordpress-development/

    I hope this information has been helpful. If I can help you in this or other questions, please let me know!

    Cheers, Luís

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.