Support Forum

Advanced Search
Forum Scope


Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
coding-topic
Simple Press forum & category access from Wordpress Capabilities instead of User Roles
Avatar
tobbe
Member
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2013 - 1:59 am

With the approach above I wouldn't need to create 1 wp user role for every possible combination of products but can simply define 1 wp capability per product and then assign forum and category access by using the groups function in the manner described above and allow them to "stack" like add multiple user capabilities per forum or category as needed.

 

Avatar
tobbe
Member
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2013 - 2:08 am

I also just realised that doing the above would effectivly mean that you guys integrate with WooCommerce and that you can sell forum and or category access as a product inside of WooCommerce (not taken into account any other woocommerce conflicts).

Sure the woocommerce owner would need a few other supporting plugins for woocommerce but thats not something you guys need to worry about ;)

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 19, 2013 - 2:57 am

The idea is to have the admin write whatever he has called the respective wp capability into the admin and then simple press checks to see if a user has that wp_user_capability and grants access to the forum.

This ignores the complete and total SP permission model. Being a member of a specific User Group does NOT grant access to anything. It is the combination of a user group and a permission set when assigned to an individual forum that controls whether an individual user can view that forum along with all other authorisations. Adding your capabilities to a user group record would change nothing except, perhaps, it could be used to determine which user group a new registrant belonged to - as long as that data existed at sign-up time.

andy-signature.png
YELLOW
SWORDFISH
Avatar
tobbe
Member
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2013 - 4:12 am

Ahh yes, I missed the final step there.

In the forum or category permission screen you would match up the access with the custom group I created above just like when integrating with the WP user role (in ragards to where the forum and categories check for permissions).

They look for permission information from the user groups settings and it's in the user groups setting that the plugin/add-on would add the

is wp_capability _______ field where the check is done to see if a specific user has the right wp capability or not.

As such it is not a modification of how the forums or categories check permissions but rather how the user groups
checks to see if a WP user has the right "capability" or not.

I hope this makes more sense?

Avatar
Mr Papa
Simi Valley, CA
SP Master
Free Members
sp_UserOfflineSmall Offline
Feb 19, 2013 - 7:43 pm

sort of... but still a significant departure on how our permissions and accesses work...  I dont believe it would be a simple plugin or core changes...  but I could still be missing something...

Avatar
tobbe
Member
Free Members
sp_UserOfflineSmall Offline
Feb 20, 2013 - 12:49 am

Before proceeding I just want to check that you guys understand my suggestion on how I see this working from an "admin" point of view?

Secondly perhaps this can shed some light upon the "coding/programming" point of view?

http://codex.wordpress.org/Fun.....t_user_can

So in the Simple Press user groups setting another option is added as described above where the function you have in place is something similar to the link above.

ex.

if ( current_user_can('moderate_comments') ) {
echo 'The current user can moderate comments';
}

In my suggest case I would define a user capability. Inside of the Simple Press Groups Permission, there is a setting where I can define the parameter for what the if code looks for so the logic would look something like this

if ( current_user_can('mycustom_capability') ) {
echo 'Grant Permission to the simple press group ';
}

ex. Multiple capability check

if ( current_user_can('mycustom_capability1', 'mycustom_capability2', 'mycustom_capability3') ) {
echo 'Grant permission to the simple press group or the user is automatically added to the user group. Not fully sure how the coding backand works with simple press for this function'.
}
 

I understand this is a bit more ellaborate then in the example, I just hope it better illustratres from a programming perspective what I am trying to achieve. I also realise that this deviates from how simple press currently works for checking permissions which is, of course, why were having this discussion as WP user roles integration simply isn't practical in my case.

I really don't have an alternative to Simple Press (belive me I've done my research) and from a business perspective I don't have any other options then to A) find a customization / programmed solution as described above or B) Manually give every customer & user their respective relevant forum access which increases admin work load for me but more importantly increases waiting time for the customer and also increases the chances of humar error.

Please let me know if I need to better describe what I am need Simple Press to do or if I in any other way shape or form can be an active part in moving this forward. I don't have your guys programming or hands on knowledge of either Wordpress or Simple Press from a programming perspective which makes it harder for me to grasp the full scope of the difficulties and challenges that lies ahead.

 

 

Avatar
Yellow Swordfish
Glinton, England
SP Master
sp_UserOfflineSmall Offline
Feb 20, 2013 - 1:58 pm

I think you are still really missing the point of how SP currently handles access control. As I have said before - it has absolutely nothing to do with WP roles. It is the 'marriage' of a set of permissions against a user group assigned at forum level.

What you are suggesting negates all of that infrastructure and all of the current permission checking throughout the entire forum. That touches much, much more then whether a user can 'view' a forum or create posts.

andy-signature.png
YELLOW
SWORDFISH
Avatar
Melanie Nelson
Member
Free Members
sp_UserOfflineSmall Offline
Feb 20, 2013 - 2:39 pm

I've been watching this thread with some interest, because I currently have a client wanting to do the same thing.  however, unlike the OP, our setup is different, and I'm wondering if the OP is missing a step.

We're using a combination of WooCommerce, WishList Member, and Simple:Press.  My client is selling online courses, basically, and we needed WooCommerce to sell these courses as product bundles: you'll be getting PDF worksheets and other file downloads, as well as access to the classes in video format, and access to a private forum for just that particular class.

We used WishList Member to create "Membership Levels", which we've mapped to groups in Simple:Press. So there's no need to actually mess with the Roles - it's just a checkbox/setting in the database that sets a membership level that's mapped to a group in the forums.  So when someone purchases a course, they are returned to the site to access the downloads and the video classes.  Right now, I'm currently trying to figure out how to get the forums to recognize the newly added membership level.  The idea is that I can hook into WooCommerce to see if the purchase was successful, and upon the variabel that states is *was* successful, then I can update the WishList Membership level for that user, and tab into the database and update the forum access (by adding the user's name to the Forums > Manage User Groups > Add Members)  I haven't completely gotten to that point, though - WooCommerce's hooks are proving to fight me a bit on this, and won't tell me if a purchase was successful so it will trigger the updates. :)

This process WILL require the admin to create membership levels and forum group permission sets for every course. But there's no need to create a new role for every single item - which is good because if you *based* it on the user role, then they would purchase 3 different courses, but could only access one because of their role.  Using the membership levels instead allows them to belong to multiple levels and not have that problem.

Avatar
tobbe
Member
Free Members
sp_UserOfflineSmall Offline
Feb 20, 2013 - 3:39 pm

I see, is there any way to make it so that the plugin groups can controll simple press forum access or somehow assign customers a specific forum access on a per product basis? 

This is the API info the programmer has available

http://www.itthinx.com/documen.....roups/api/

Avatar
Melanie Nelson
Member
Free Members
sp_UserOfflineSmall Offline
Feb 20, 2013 - 3:49 pm

These are the instructions we used to map the membership levels to Simple:Press groups.

How to configure Simple:Press with a membership plugin?

 

You can assign logged-in users specific forum access by going into Forums > User Groups > Manage User Groups, find the forum you want to add members to and click "Add Members"

 

Forum Timezone: Europe/Stockholm
Most Users Ever Online: 1170
Currently Online:
Guest(s) 1
Currently Browsing this Page:
1 Guest(s)
Top Posters:
Mr Papa: 19448
Ike: 2086
Brandon: 864
kvr28: 804
jim: 650
FidoSysop: 577
Conrad_Farlow: 531
fiddlerman: 358
Stefano Prete: 325
Member Stats:
Guest Posters: 620
Members: 17365
Moderators: 0
Admins: 4
Forum Stats:
Groups: 7
Forums: 17
Topics: 10128
Posts: 79626