Resources

My Agape try

Your Agape try


Support Forum

Current User: Guest Login Register
Please consider registering

Search 
Search Forums:


 




Limit access to features provided by plugin?

UserPost

7:56 pm
October 21, 2009


error792

New Member

posts 1

1

I manage the athletics portion of my school website, and one of the important features is the ability for coaches to post scores. This is achieved by a custom WP plugin I wrote; I use RS to limit coaches to posting scores only to the teams they coach. Previously this was achieved by allowing people to post scores for a team if and only if they were allowed to edit the team's page on the main website; now, however, we would like to allow some students to post scores, without allowing them to edit the team pages.

The issue is that all the score-posting is done from one page, and I need it to filter the content on this one page; from looking at the example NGGallery extension as well as the defaults_rs.php and role-scoper_main.php, I can't tell if this is possible with RS, or if so, how to do it. (there should be permissions "Post Women's Basketball Scores", "Post Indoor Soccer Scores", etc.)


Any help with this would be greatly appreciated. Thanks again for the great plugin!

3:23 pm
October 28, 2009


Kevin

Admin

posts 1326

2

Code-wise, the simplest solution would be to:

  1. Use Capability Manager to create a copy of the WordPress role which said students have.
  2. Add the capabilities "post_womens_basketball_scores", "post_indoor_soccer_scores", etc.
  3. Change said students' WP Role to this newly defined one.
  4. Where you are checking for page edit capability, add an " || current_user_can( $capability_name ) " clause

If you want to go all out and create an RS Extension for your plugin (based on the RS-NGG model), that would offer the advantage of letting you assign the posting capabilities only for specific pages. Let me know if you need more advice in that direction.



Reply to Topic: Limit access to features provided by plugin?

NOTE: New Posts are subject to administrator approval before being displayed

Guest Name (Required):

Guest EMail (Required):

Guest URL (required)

Math Required!
What is the sum of: 3 + 5        (Required)

Topic Reply:


 

About the Agapetry forum

Currently Online:

12 Guests

Maximum Online: 88

Forums:

Groups: 2

Forums: 7

Topics: 667

Posts: 3053

Members:

There are 601 members

There are 1 guests


Kevin has made 1326 posts

Top Posters:

metal450 - 98

YikYak - 58

Ragnar - 36

Daisy - 35

LorenW - 33

Administrator: Kevin | Moderators: Kevin