Page 1 of 1

Making BuddyPress read-only for non-members

PostPosted: July 6th, 2011, 7:58 pm
by kgweber
I am setting up a non-profit site using s2member and BuddyPress. We'd like to control BuddyPress access to allow non-members to see most of the content but only allow members to update.

For example, non-members can browse groups, however, only members can join them.

The default BuddyPress logic works fine -- people who are not logged in do not have the option to join groups etc. However, we'd like to extend this same level of access to members whose membership has expired. Ideally they could be logged in but would not be able to make changes to their membership until they renew it.

How can I achieve this using s2member? The general blocking of content and URIs works great, but this is a different level of detail, and I'd like to avoid too much BuddyPress customization if I can help it. Has anyone done something similiar?

Re: Making BuddyPress read-only for non-members

PostPosted: July 7th, 2011, 3:13 am
by Cristián Lávaque
I'm not sure of all the details, but I'd look at editing the Subscriber (level 0) role with User Role Editor, to remove the capability you want to disable. https://wordpress.org/extend/plugins/user-role-editor/

I hope that helps. :)

Re: Making BuddyPress read-only for non-members

PostPosted: July 7th, 2011, 4:21 pm
by kgweber
I'll look into this, but unless I'm missing something BuddyPress doesn't look at the roles capabilities for most functions -- it just distinguishes between users and non-users. For example, I think you are allowed to join a group if you are a logged in user, and prohibited from joining a group if you are not. In my case, what I'd like to do is make an expired membership user behave like a non-user, and I'm hoping there is a simple approach to this that does not involve custom edits to themes or BuddyPress pages.

Further thoughts?

Re: Making BuddyPress read-only for non-members

PostPosted: July 7th, 2011, 5:01 pm
by Cristián Lávaque
I'll email Jason asking him about this.

Re: Making BuddyPress read-only for non-members

PostPosted: July 8th, 2011, 5:06 pm
by Jason Caldwell
Thanks for the heads up on this thread.
kgweber wrote:I'll look into this, but unless I'm missing something BuddyPress doesn't look at the roles capabilities for most functions -- it just distinguishes between users and non-users. For example, I think you are allowed to join a group if you are a logged in user, and prohibited from joining a group if you are not. In my case, what I'd like to do is make an expired membership user behave like a non-user, and I'm hoping there is a simple approach to this that does not involve custom edits to themes or BuddyPress pages.

Further thoughts?

No, I'm not aware of any way to achieve this without making edits to your BuddyPress theme, taking advantage of Conditionals made possible by s2Member. For further details, please take a look in your Dashboard under: s2Member -> API Scripting -> Advanced/PHP Conditionals. That being said, I would certainly take a look through the plugins available for BuddyPress before you custom code this. I'm sure you'll find something at BuddyPress to assist in this regard. http://buddypress.org/extend/plugins/