Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sync Membership with Role AND Capabilities #38

Open
jbonlinea opened this issue Nov 8, 2021 · 2 comments
Open

Sync Membership with Role AND Capabilities #38

jbonlinea opened this issue Nov 8, 2021 · 2 comments

Comments

@jbonlinea
Copy link

Hi there,

I've been thinking more than once wether I should use role or capabilities as the right syncing method, wondering if capabilities wasn't' overkill for my need, whil thinking that it may be nice to be able to programatically displace content according to memberhsip staut.

In the end I wen for capabilities, which do the job great by itself.

However roles are handled by many wp plug-in, while capabilities aren't, I mean distinguis user based on their role and not their capabilities.

Now, I'm facing an other user case where I NEED to use role (at least to simplify my life). I could, but that I'll lose the ability to distinguish user based on their membership statut, which is very sad.

I'm thus wondering... why couldn't get the best of both world ?
If one select role as syncing method,

  • the roles could be added/remove according to the active/not active mebership; as it is now great ; and
  • wp-member-sync, still created the membership statute capabilities, and grant them ? (it might not create the member capability, but only the member statute capabilities, as membership is handled by roles)

Could this be doable or is it heretic ?
is there a use case that could disqualify this approach ?

I feel the need for simplicity with role so "basic" needs are covered simply, and I feel the need for capabilities for fine tuning custmisations, but I can't think of a situation where adding membership statute on top of user role could break something.
(of course the pure capability approch may remain as it is as not every use case may want to create new role for each membership type)

What do you think ?

Cheers

side note : anyhow, this plug-in is a huge step forward, and I'll never say it enough, but thank you for this and everything else :)

@christianwach
Copy link
Owner

You can use this action with a callback that implements the capabilities code to achieve what you want.

@jbonlinea
Copy link
Author

Hi

Ok cool thank's

However may I ask why having either capability only or role only, and not either capability only or role+capability ?

I understand that not anyone need/want role, but I don't understand how having capabilities on top of role may be detrimental ?
Is it to be savy ? and if yes savy in what server processing resource, database usage ? is that this big to be critical ?

Then why not having capabilities, roles and capabilities+role for who needs. Setting the latest would be exactly like role but the capability would be granted too.

Cheers

@christianwach christianwach changed the title Sync membership with Role AND create the capabiltie Sync Membership with Role AND Capabilities Sep 23, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants