Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Is there an 'Authorize' Function to Decide Role

UserPost

8:27 pm
September 8, 2011


deegs

New Member

posts 1

1

Hey, geeks. :)

I'm dealing with a fairly straight forward (but proprietary) API where I can do a quick call for user information and a subscription check. There are 2 basic calls:

userInformation: Can send it a WordPress ID and return includes: userid, email, subscription status and subscription expiry date.

subscriptionCheck: can be used anytime with a WordPress user id. This will be helpful when a user registers and you needed to check and see if a user is authorized to view the content.

My question is, where do I begin to look to find a way to easily integrate with Role Scoper? Am I losing my mind? Does this sound like something that can be done with this plugin? :)

I spent a few hours today and have the core functionality of Role Scoper just how I want it but now it's just a matter of putting in a these few checks and sort of automating the management of users and their statuses. 

Before I dive into the code and start hacking away, can any more seasoned vets show me the light? Any insight appreciated. 

Deegs

6:59 am
September 9, 2011


Kevin

Admin

posts 2503

2

I'm not sure whether you're looking for WP role, Scoper-assigned sitewide ("General") roles, or something else. But this will get you started:

$user = rs_get_user( $user_id );
print_r( $user->roles );
print_r( $user->groups );
print_r( $user->assigned_blog_roles );
print_r( $user->assigned_term_roles );

About the Agapetry forum

Currently Online:

11 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1247

Posts: 5656

Members:

There are 1259 members

There are 1 guests


Kevin has made 2503 posts

Top Posters:

metal450 - 178

Ragnar - 108

YikYak - 70

whiteorb - 49

Daisy - 35

Administrator: Kevin | Moderators: Kevin