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.

Restrict level 2 from level 1 content

Home Forums Community Forum Restrict level 2 from level 1 content

This topic contains 9 replies, has 4 voices. Last updated by  Cristián Lávaque 4 years, 9 months ago.

Topic Author Topic
Posted: Sunday Mar 25th, 2012 at 12:44 am #9022

Hello,

I’m trying to use levels 1 and 2 to release two different products. I want to restrict level 2 from accessing level 1 content. it this possible?

Thanks!

List Of Topic Replies

Viewing 9 replies - 1 through 9 (of 9 total)
Author Replies
Author Replies
Posted: Sunday Mar 25th, 2012 at 4:56 am #9032

Hi Jordon.

You may prefer to use custom capabilities in that case.

I hope that helps. :)

Posted: Sunday Mar 25th, 2012 at 1:14 pm #9048

Thank you for the quick response Cristian.

Is there a simpler way to do this? All I need is for level 2 to not have access to level 1 content.

I do not have a developer or know php. Thanks again.

Posted: Sunday Mar 25th, 2012 at 1:34 pm #9049
Eduan
Username: Eduan
Moderator

Hello Jordon, thanks for the follow-up.

While you can’t restrict the post, he will still be able to access it, you can cerainly make sure he can’t see the content of the post. Using conditionals, which you can find under Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals.

There is also a KBA (Knowledge Base Article) on conditionals:
Knowledge Base » s2Member® Conditionals

Would this work for you?

Posted: Sunday Mar 25th, 2012 at 1:42 pm #9050

Hi Eduan, yes this helps. But what im trying to do is simply turn off incremental access. Here are the default settings.

Membership Levels provide incremental access:

* A Member with Level 4 access, will also be able to access Levels 0, 1, 2 & 3.
* A Member with Level 3 access, will also be able to access Levels 0, 1 & 2.
* A Member with Level 2 access, will also be able to access Levels 0 & 1.
* A Member with Level 1 access, will also be able to access Level 0.
* A Subscriber with Level 0 access, will ONLY be able to access Level 0.
* A public Visitor will have NO access to protected content.

Here is what I’d like:

* A Member with Level 4 access, will NOT have access to Levels 0, 1, 2 & 3.
* A Member with Level 3 access, will NOT have access to Levels 0, 1 & 2.
* A Member with Level 2 access, will NOT have access to Levels 0 & 1.
* A Member with Level 1 access, will NOT have access to Level 0.

Posted: Sunday Mar 25th, 2012 at 2:18 pm #9056
Eduan
Username: Eduan
Moderator

Thanks for the follow-up.

So sorry, this is currently not possible, only with custom capabilities which are independent of each other would you be able to do this.

Another possibility is using specific post/page access restrictions, which you can find under Dashboard -› s2Member® -› Restriction Options -› Specific Post/Page Access Restrictions.

We have a video on them by Jason (lead developer):
http://www.s2member.com/videos/ED64B278374AB72F/

Hope this helps. :)

Posted: Sunday Mar 25th, 2012 at 7:29 pm #9069
cassel
Username: cassel

Jordon, custom capabilities might look scary but they are not. I am not a tech person. I even struggle with simple html, yet, i managed to get a lot of custom capabilities coded into my site. Once you get the list of shortcode and you know what the basic code is for the simple conditionals, you will be going through it smoothly.

If you can think logically of the reasoning, you can code it, i promise:

if user has access to “category1” –> here is the content for category1
if user has access to “category2” –> here is the content for category2
and so on.
So whoever has access to category1 will not see what is in category 2, or 3 or 4 or 10 for that matter (yes, with the custom capabilities, you can have unlimited “categories”). Isn’t that neat?

Posted: Sunday Mar 25th, 2012 at 10:28 pm #9079

Yeah, custom capabilities can be used in advanced scripts, but they can be as simple as setting a level requirement for a post. in you rpost edit page, go to the s2Member box and type the custom capability you want to require for access to that post/page. It’s that simple. :)

Posted: Sunday Mar 25th, 2012 at 11:37 pm #9082

Thanks again for the replies. I’m still having trouble.

So lets say I have a page that level 1 has access to, but I want to restrict to Level 2 from viewing. In the s2member shortcode box on the right sidebar in that specific page I would enter:

[s2If current_user_is(s2member_level2)][/s2If] [s2If current_user_cannot(access_s2member_level1)][/s2If]

Is this correct?

Posted: Monday Mar 26th, 2012 at 5:18 am #9089

No, you’d do something like:

[hilite pre_code]
[[s2If current_user_is(s2member_level2)]
Some premium content for Level 2 Members.
[/s2If]]

[[s2If current_user_is(s2member_level1)]
Some premium content for Level 1 Members.
[/s2If]]
[/hilite] [hilite path]Dashboard -› s2Member® -› API / Scripting -› Simple/Shortcode Conditionals -> Example #3[/hilite]

But if you used custom capabilities, you’d just have them all at Level 1, but one group with a custom capability and the other group with another capability, e.g. group1, group2.

Then to your pages from Group 1 you’d add the requirement of having the custom capability group1. You’d do that from the box in the edit page’s sidebar.

Viewing 9 replies - 1 through 9 (of 9 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.