latest stable versions: v150827 (changelog)

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Member-specific restriction options

Home Forums Community Forum Member-specific restriction options

This topic contains 5 replies, has 2 voices. Last updated by  David Welch 3 years ago.

Topic Author Topic
Posted: Tuesday Dec 10th, 2013 at 10:33 am #61795

Can we restrict pages/posts by user ID rather than member level? I am trying to come up with a way to have members log in and only see pages and posts they they are allowed to see based on their specific member ID (user ID in WordPress), not “member level”.

Scenario:
I have a site where I only want to show certain posts/pages to specific members. For example, Client A logs in with their unit user name and password and they would see those posts and pages I’ve built for them only. Client B could log in and see only their posts and pages created for them, and so on.

I know we can restrict by member “level” but what about by specific members? I wont have too many so I don’t mind if I need to set things up manually for each client’s permissions but I just need to know if s2member plugin can handle this or if I need to find a different membership system.

Your Thoughts? Thanks!

List Of Topic Replies

Viewing 5 replies - 1 through 5 (of 5 total)
Author Replies
Author Replies
Posted: Wednesday Dec 11th, 2013 at 8:17 pm #61845
David Welch
Username: dwbiz05

Yes, just add a specific, unique Custom Capability to each Client’s user account.

Then add that custom capability to the Page / Post Custom Capabilities Meta Box (upper right of page edit screen).

So if the user has a capability that is required on that page, they can see it.

Does that make sense?

Dave

Posted: Wednesday Dec 11th, 2013 at 8:23 pm #61847

Great to hear! …But I’m not sure what a “Custom Capability” is. Can you give me a code example of what that would look like so I can implement that?

Thanks!
Joe

Posted: Wednesday Dec 11th, 2013 at 8:32 pm #61852
David Welch
Username: dwbiz05

Really, it’s just whatever you want it to be…

So, if I want Bob to only have access to specific pages I might add the custom capability “bob” or if he likes popcorn I might use “popcorn”.

It’s 100% your choice as long as the user’s capabilities match the page/post capability.

Does that make sense? Do you see where to add it for users and where to add it for posts/pages?

Dave

Posted: Wednesday Dec 11th, 2013 at 8:46 pm #61854

Ok, got it. :) I just tested that with an example page and it worked great.

Thanks!

Posted: Wednesday Dec 11th, 2013 at 8:56 pm #61857
David Welch
Username: dwbiz05

Awesome!

Viewing 5 replies - 1 through 5 (of 5 total)

This topic is closed to new replies. Topics with no replies for 2 weeks are closed automatically.

Old Forums (READ-ONLY): The community now lives at WP Sharks™. If you have an s2Member® Pro question, please use our new Support System.

Contacting s2Member: Please use our Support Center for bug reports, pre-sale questions & technical assistance.