Page 1 of 1

Level specific access only???

PostPosted: August 5th, 2011, 9:32 am
by mrnic3guy
Hi. I love your plugin, but before I purchase s2member, I just wanted to see if s2member supports the ability to create level specific pages upon login. In the free version, I'm able to restrict access to different levels such as "level 3 or higher." My question is, can I restrict level 3 content to just level 3 users? I don't want level 4 to be able to access level 3 at all. Also, is there an ability within s2member to also restrict the sub-pages of level 3?

I've searched the forums, but haven't found what I'm looking for.

Re: Level specific access only???

PostPosted: August 5th, 2011, 10:47 pm
by Cristián Lávaque
Protection for pages won't include their child-pages unless you protect them too.

A way to do level specific protection is with conditionals, but those won't bounce the person to the Membership Options Page like Page Access Restriction does. WP Admin -> s2Member -> API / Scripting -> Simple/Shortcode Conditionals -> Example #3

You could use Custom Capabilities, they aren't incremental as levels are and will bounce the person if that's what you want. http://www.s2member.com/custom-capabilities-video/

I hope that helps. :)

Re: Level specific access only???

PostPosted: August 9th, 2011, 10:23 am
by ZebEl
Using shortcode is working perfectly thanks to s2Member. :) The only problem is that admin himself can not access all content but only the public one. I hope that this kind of capabilities will be solved in the future to be able to link member levels to existing user capabilities in Wordspress, like: level1=contributer, lever2=author, levels 3-4 authors+cutom capabilities, etc.

However, I solved it like the following:

[s2If current_user_is(s2member_Level 4) OR current_user_is(administrator)]
Some premium content for Level 4 Members.
[/s2If]

[s2If current_user_is(s2member_Level 3) OR current_user_is(administrator)]
Some premium content for Level 3 Members.
[/s2If]

[s2If current_user_is(s2member_Level 2) OR current_user_is(administrator)]
Some premium content for Level 2 Members.
[/s2If]

[s2If current_user_is(s2member_Level 1) OR current_user_is(administrator)]
Some premium content for Level 1 Members.
[/s2If]

[s2If current_user_is(s2member_Level 0) OR current_user_is(subscriber)]
Some content for Free Subscribers.
[/s2If]

[s2If !current_user_can(access_s2member_Free)]
Some public content.

[/s2If]

Re: Level specific access only???

PostPosted: August 9th, 2011, 1:28 pm
by Cristián Lávaque
Admins should be able to see anything s2Member is protecting without you needing to do anything else.

There is in the current version a bug where he can't see content protected with custom capabilities that he doesn't have, but that's fixed for the coming release.

If you want to set up restrictions for existing WordPress roles, using the conditionals is perfectly fine.

Re: Level specific access only???

PostPosted: August 9th, 2011, 1:53 pm
by ZebEl
Thanks Cristián,

Regarding the bug, I'll reverse the code when a new release is available.

Re: Level specific access only???

PostPosted: August 9th, 2011, 1:57 pm
by Cristián Lávaque
:)