Resources

My Agape try

Your Agape try


Introducing Role Scoper for WordPress

Intro to WordPress Roles · Role Scoper Description · Acknowledgements · Download · Usage Guide · News


WordPress: Capabilities, Roles and Wish Lists
Whenever you access a WordPress site, the software considers what you are trying to do: read a post, edit a page, manage categories. Most sites allow you to read posts and pages without logging in. Any other operation you may request is permitted only if your user definition (as identified by login name and password) includes a corresponding capability.

For administrative convenience, WordPress bundles capabilities into collections called roles. By default, these roles are:

Subscriber:

  • read published posts and pages

Contributor:

  • all Subscriber capabilities
  • contribute a post (for review by editor), and edit it before publication

Author:

  • all Contributor capabilities
  • contribute a post, publish/unpublish/edit it, and moderate its comments

Editor:

  • all Author capabilities
  • contribute/publish/unpublish/edit any user’s post
  • contribute or edit any page
  • manage all categories and moderate any comment
  • read posts and pages which are marked “private”

Administrator:

  • all Editor capabilities
  • define users and assign them roles
  • configure all site options

This role configuration works well for WordPress’ conventional application as a single-user blog. But what if you want someone to contribute their own pages without editing other’s post or pages? Or maybe some users should edit other’s posts without being able to edit pages at all. The current solution is to use an existing plugin like Role Manager to either redefine “Editor”, or create a cloned “Special Editor” role, moving existing Editors to it as needed. As plugins come on board with additional capabilities, the role permutations increase. This one-role-per-user paradigm makes for simple source code and queries, but as a site shifts from single-user blog to multi-user CMS, role creation / editing is inconvenient for both developer and site administrator.

If you manage to successfully define and assign custom roles for your WordPress CMS, soon you will wonder how to grant reading or editing capabilities for multiple subsets of posts or pages. On your WordPress-powered high school news site, how can you enable someone to post only to the “Sports” category? On your corporate intranet site, can you conveniently enable members of HR to edit existing and future personnel policy pages (but not the engineering best practices pages)? Can you enable someone to create a new page, but specify a subset of “parent” pages it can be linked to? Can all these content-specific roles be administered on a sectional basis, or must someone edit/administer the whole site or nothing?

By default, WordPress doesn’t have a good answer to those CMS dreams, regardless of any custom roles you may define.

Some past and current WordPress plugins (Limit Categories, Category Visibility, Post Levels, Restrict Pages, Disclose Secret, WP-Group-Restriction) have dealt with pieces of this permissions puzzle. Using them, I appreciated a multitude of useful features. Yet as I tried and tried again to combine and configure this plugin assortment to meet all my WordPress CMS aspirations, there was always a missing piece.

Enter Role Scoper

Role Scoper is a comprehensive enrichment for capability enforcement and administration in WordPress. Assign reading, editing or administration roles to users or groups on a page-specific, category-specific or other content-specific basis.

Scoped Roles in User Profile

screen shot: Scoped Roles in User Profile

User Group Edit Interface

screen shot: User Group Edit Interface

Existing WordPress roles are honored by default, but with Role Scoper can be:

  • supplemented with content-specific role assignment
  • disregarded if the role is restricted for the category or page/post
Section Roles

screen shot: Section (Category) Roles
view full scrolled Section Roles Interface

note: “Exclusive Sections” are now called “Category Restrictions”.  This doc to be updated.

Section Roles

screen shot: Exclusive Sections (Categories)

view full scrolled Exclusive Sections Interface

Scoped role requirements and assignments are reflected in every aspect of the WordPress interface, from front end content and navigation to administrative post and comment totals. Content administrators control who can view/edit/administer specified content, and what content anonymous users see.

Section and object roles can be set to propagate to child sections/objects. User groups can be created and assigned roles. Choose whether unqualified front-end content is hidden or replaced with a customizable teaser. The object role assignment UI indicates where users have a role implicitly applied through another blog, section or object role assignment. Other plugin and core developers will be interested in the underlying users_who_can function, made possible by a new roles storage schema.

Object Roles - Post

screen shot: Object Roles - Post

Object Roles - Page

screen shot: Object Roles - Page

The abstract data model and API support additional data sources, object types, capabilities and taxonomies (using term_taxonomy or other custom schema). If your plugin uses the WordPress current_user_can function and supports filtering of its listing query, you can use Role Scoper’s API to define your data source, object types, sections and scopeable roles. These will supplement any other assigned roles; there is no need to merge all capabilities into an all-inclusive role.

Realms Selection
screen shot: Role Scoper Realms Selection
view full scrolled Realms Interface
view full scrolled Options Interface



Role Scoper is currently a public beta release. All intended features are present and currently undergoing further testing prior to official release (and pending your feedback). This plugin is open source software released under the General Public License (GPL). Given family needs, I will probably never again donate unpaid design labor on the scale Role Scoper required. However, I do plan to provide some free support, correct bugs which emerge and revise the plugin for future WordPress versions. If it adds value to your website or saves you time and money, you can express appreciation in several ways:

Comments

Pingback from mijn nieuwste favorieten van Friday, 23 May 2008
Time: May 23, 2008, 4:34 pm

[...] Role Scoper Plugin for Wordpress | Agapetry (tags: auteurs gebruikers roltoekennen wordpress) bewaar bij: [...]

Comment from Chris Masse
Time: May 30, 2008, 3:48 pm

I got that:
“Your attempt to edit this post: “XXXXXX” has failed.”
-
Thanks for your work making this plugin.
-
Chris Masse

Comment from Kevin
Time: May 30, 2008, 4:16 pm

Chris,

Since that error doesn’t happen for every post edit attempt, can you say a little more about the configuration and steps that led to it?

Was this a new or existing post? Private, published or draft? Were you logged in as admin? If not, what WP blog role did the logged user have? Did any of the stored or selected post categories have role(s) marked as exclusive? If so did the logged user have any of those section role(s) assigned? Did the post have any roles marked exclusive? Any object role assignments for the logged user?

Comment from Chris Masse
Time: May 31, 2008, 2:51 am

I did just enable the plugin without parametering it.
-
That error was not shown to me (the admin) but to one of my co-author.
-
It was a draft.
He was an author.
As I said, the plugin was enabled but I did touch the options.
-
Thanks
Chris Masse

Comment from Kevin
Time: May 31, 2008, 9:38 am

Thanks, Chris, for this bug report.

I have reproduced the error and am working on a fix.

Comment from Simply Geek
Time: June 1, 2008, 3:53 am

thanks for the amazing plugin. I was looking for this.I am in the process of developing a new wordpress plugin for my site.This will help in my venture.Thanks a lot..

Comment from jocuri
Time: June 4, 2008, 5:16 pm

thanks very useful plugin

Comment from Phil
Time: June 14, 2008, 4:44 pm

Amazing work. Thanks a lot!

Comment from Stefano, Wordpressmania.it
Time: June 16, 2008, 9:05 am

Awesome plugin…

but let’s say that I want to give to all the users who have the ‘Author’ role the ability to edit one and only one specific page, and no access to write/edit posts, links, category, etc…

How can I achieve this result with your plugin?

Comment from Joe Banks
Time: June 19, 2008, 3:42 pm

Holey Moley. This looks just like what I have been looking for! Here’s something for your FAQ. Does this replace functionality of the Role Manager plugin? http://www.im-web-gefunden.de/wordpress-plugins/role-manager/

Comment from Damiano
Time: June 19, 2008, 4:54 pm

I was receiving an error (unexpected endif statement on line 239 in admin/groups.php) whenever I tried to access the Groups page. The error was caused by a missing closing brace for the IF statement on line 175. I solved it by replacing the opening brace with a “:”, and then adding “endif;” on line 192.

Comment from Damiano
Time: June 19, 2008, 5:19 pm

To correct my previous comment: the error wasn’t caused by a missing brace (it is there, with an accompanying comment, on line 233), but by the fact that line 232 started with a short-style PHP tag. Having the support for short-style PHP tags turned off, I was receiving the error above. The fix was, simply, to use the standard PHP tag (”<?php” instead of “<?”).

Comment from Kevin
Time: June 19, 2008, 5:30 pm

Damiano,

I wonder if you have a bad download. My copy of groups.php does have a closing brace for that IF statement. In fact, the closing brace on line 233 is followed by a comment matching it to the if statement you mention.

I’m glad you were able to work around that error, but modifying groups.php as you describe creates an error for me. If it still looks like that workaround is necessary on your installation, please mail me a copy of your file so I can look into it further.

Comment from Kevin
Time: June 19, 2008, 5:33 pm

Okay, I just saw Damiano’s last comment and have replaced the php short tag with a proper “<?php” for the next revision.

Thanks for catching that.

Comment from Kevin
Time: June 19, 2008, 6:17 pm

Joe,

Thanks for that jovial introduction. Your excited discovery reminds me of why I undertook this project in the first place.

The Role Manager question does now qualify as an FAQ, and I plan to put together such a document soon. Until then, the following is a short answer (longer explanation here):

Role Scoper will coexist with Role Manager by
* defining additional, supplemental roles (including blog-wide)
* filtering the application of “regular” WP blog roles for certain content

I chose not to go all the way and provide WP blog role definition and assignment because I don’t know where the WP core role storage schema is headed and prefer to treat it as a black box at this point.

Comment from Kevin
Time: June 20, 2008, 1:25 am

Stefano,

You can do that (enable Authors to edit one page and nothing else) as follows:

* Install the Role Manager plugin and use it to remove the “edit_posts” capability from the Author role. Can also remove all other caps except “read” if you want.

* While logged in as admin and with Role Scoper activated, edit the page you want Authors to edit.

* Expand the “Editor” dialog. Click on “Groups” and select “[WP Author]”

* Save the page

Prior to the new revision, these authors could still get into the “Write Post” / “Write Page”, but could not save anything as published. Now they won’t even see the “Write” menu link.

Comment from Stefano, Wordpressmania.it
Time: June 20, 2008, 5:13 am

Kevin, thanks for your help… I will try it ;-)

Stefano

Comment from Ken
Time: June 26, 2008, 11:43 pm

This looks like a great plugin, exactly what I needed!

I understand how to do what you told Stefano to do, but I want to also allow users in a certain group to add new pages, but force them to make the parent page one of the other pages that they own. Your writeup says that that should be possible, but I can’t see how to do it. If I enable publish pages for the role, then they can publish pages anywhere, but if I don’t they can’t publish pages anywhere.

Comment from Kevin
Time: June 27, 2008, 3:04 pm

I looked into this and found some bugs preventing it from working the way you expected. New version download and full description here.

You should have Role Manager remove the publish_pages cap for your users’ WP Role, then follow the instructions in the link above.

Comment from Marci :)
Time: June 29, 2008, 7:12 pm

WOW! I’m impressed and excited….this is EXACTLY what I need!! I’ve got it running, now I just have to figure out how to use it….THANKS SO MUCH!!!!

Comment from zack
Time: June 30, 2008, 12:54 pm

The plugin is excellent. Thanks for doing this!

Quick question: what’s the best way to redirect a user without access? Right now, when someone tries to access a protected page, Wordpress spits out the 404 page. I’d like to redirect to something more useful. Can this be done within Role Scoper or is this a Wordpress hack?

Comment from Kevin
Time: July 1, 2008, 3:51 am

Zack, if your concern is only for a specific site, I would look into a theme hack. You should be able to add some code the 404.php which gets the requested page ID, checks for its existence with something like

if ( $post_exists = $wpdb->get_var("SELECT ID FROM $wpdb->posts WHERE ID = $requested_id" )
      echo 'Sorry, you do not have permission to view this page';
else
      echo 'Normal 404 message';

Since Role Scoper is running interference farther upstream at the DB query construction, I’m not sure I want to take any more error messaging than what is already available with the teaser option.

Pingback from Role Scoper plugin for Wordpress - The Home of Tom & Morven - tombammann.homedns.org has permanently become tombammann.org
Time: July 8, 2008, 9:00 am

[...] that I couldn’t wait for Disclose-Secret to catch up, and have converted over to using Role-Scoper. As far as I can tell, Role-Scoper does absolutely everything that Disclose-Secret did, and with so [...]

Pingback from WordPress Plugin Releases for 07/08 | BlogBroker24-7
Time: July 8, 2008, 5:00 pm

[...] Role Scoper [...]

Pingback from Wp Wordpress » Blog Archive » WordPress Plugin Releases for 07/08
Time: July 8, 2008, 5:18 pm

[...] Role Scoper [...]

Pingback from Wp Wordpress » Blog Archive » Weblog Tools Collection: WordPress Plugin Releases for 07/08
Time: July 8, 2008, 5:19 pm

[...] Role Scoper [...]

Trackback from Leonaut.com
Time: July 9, 2008, 12:32 pm

Role Scoper…

Role Scoper is a comprehensive drop-in replacement for capability enforcement and administration in WordPress. Assign reading, editing or administration roles to users or groups on a page-specific, category-specific or other content-specific basis….

Comment from Richard
Time: July 10, 2008, 10:16 am

Thanks for a very comprehensive addition to the permission and role system. The documentation is quite involved and I simple want to ask this question: Can I make some category(s) accessible to registered users (subscribers) and admins only?

TIA.

Comment from Kevin
Time: July 10, 2008, 10:49 am

Sure.

Define Exclusive Categories

  • Go to WP admin >Roles > Exclusive Sections
  • For each category of concern, click the “Post Reader” and “Private Post Reader” checkbox
  • click the Update button

Assign Category Roles

  • Go to Groups > Section Roles
  • Select WP Role group(s) to assign category roles to
  • For each category this user group gets, click the “Post Reader” and/or “Private Post Reader” checkbox
  • click the Update button
  • repeat for each set of category roles

Note that if category role assignments need to be more customized, you can repeat the above process for individual users via Roles > Section Roles. Or define user groups (Groups > Groups) and repeat the above process, selecting your custom group instead of WP Role group. Later you can add or remove visibility of individual posts via the Post Edit interface if you need to.

Finally, keep in mind that all the above instructions also apply to the creating, editing and publishing of posts if you designate editing roles for Exclusive Sections and for Section Role assignment.

Pingback from Role Scoper- WP als Redaktionssystem endlich vereinfacht
Time: July 10, 2008, 11:41 am

[...] ist das Plugin Role Scoper noch im Beta Stadium, doch es vereinfacht das Anlegen von Berechtigungen und Userrollen, Gruppen [...]

Pingback from WordPress Plugin Competition Blog » Role Scoper
Time: July 11, 2008, 1:11 am

[...] Description, screenshots and download on [...]

Comment from Aces
Time: July 11, 2008, 8:56 am

I’ve just installed the plugin and got the following error:
Parse error: syntax error, unexpected T_ENDIF in C:\websites\shakey1\wp-content\plugins\role-scoper\admin\groups.php on line 238

reading the above comments I noticed line 231 started with <? - when this was changed to <?php - the error went away….

Comment from Aces
Time: July 11, 2008, 9:13 am

also exclusive_sections.php has a problem caused by a similar error which seems fixed by replacing <? with <?php on line 267 and line 312.
This is using apache on XP.

Comment from Aces
Time: July 11, 2008, 9:14 am

also using apache on X, exclusive_sections.php has a problem caused by a similar error which seems fixed by replacing <? with <?php on line 267 and line 312.

Comment from Aces
Time: July 11, 2008, 9:15 am

that should be on XP (windows) , not X

Pingback from Internetpret voor 11-07-2008 | Wat mij opvalt
Time: July 11, 2008, 2:32 pm

[...] Role Scoper Plugin for Wordpress (tags: roles plugin wordpress) [...]

Comment from Clive
Time: July 14, 2008, 6:43 am

Life saving plugin Kevin. It’s just what I was looking for to make one of my sites work the way I wanted. Thanks for you time and effort - just sent a donation. Take care.

Comment from Clive
Time: July 14, 2008, 6:45 am

Forgot to mention - the documentation would be more understandable with some examples - you have some examples as a start in your comments above . . . .

Pingback from blog.rotracker.net » Blog Archive » WordPress Plugin Releases for 07/08
Time: July 14, 2008, 11:43 am

[...] Role Scoper [...]

Comment from Robert Augustin
Time: July 15, 2008, 12:40 pm

Hi Kevin,
This looks like a great plugin and I have been looking for something like this - only I am getting a 500 Internal Server Error when I try to activate the Plugin. I had Role Manager installed but deactivated it before attempting to activate yours — any ideas why I get this error?

Keep it up,
Robert

Pingback from WordPress Plugin Releases for 07/08 | Wordpress Blog NL Hosting
Time: July 16, 2008, 1:30 am

[...] Role Scoper [...]

Comment from Kevin
Time: July 16, 2008, 2:14 am

Robert,

I haven’t seen or heard Role Scoper cause that kind of error, and don’t have any initial guesses how it would.

Can you possibly e-mail me a copy of your php error log and (if it’s not confidential) .htaccess file?

Comment from Kevin
Time: July 16, 2008, 3:43 am

Thank you, Clive, for the donation. It’s encouraging.

The Role Scoper Usage Guide now includes a How To section with some step-by-step instructions. To be expanded to cover editing roles and other topics…

Comment from Vinny
Time: July 16, 2008, 3:31 pm

I am also getting a 500 internal error when i activate the plugin…

Comment from Mike
Time: July 16, 2008, 3:53 pm

Hey Kevin, thanks for this wonderful plugin! I upgraded to WordPress 2.6 today and seem to be having an error when saving pages and posts. When I click save, the page shows all the Role Scoper options without styling and has

“Warning: Cannot modify header information - headers already sent by (output started at /home/ascensio/public_html/wordpress/wp-content/plugins/role-scoper/admin/filters-admin_rs.php:536) in /home/ascensio/public_html/wordpress/wp-includes/pluggable.php on line 770″

at the bottom. The page did save, but that still happens everytime.

Comment from Kevin
Time: July 16, 2008, 4:02 pm

Thanks, Mike, for that report. I’ll look into it soon and contact you if I can’t reproduce on my installation.

Comment from Kevin
Time: July 16, 2008, 4:58 pm

Any WP 2.6 users who want to eliminate this annoyance prior to the next Role Scoper revision can edit plugins/role-scoper/admin/filters-admin_rs.php as follows:

Change

	function flt_theme_root($path) {
		if ( awp_ver('2.5') ) {

to

	function flt_theme_root($path) {
		if ( awp_ver('2.5') && empty($_POST) ) {

Comment from Mike
Time: July 16, 2008, 5:03 pm

It does only occur with pages, not posts.

Comment from Robert Augustin
Time: July 16, 2008, 8:36 pm

Kevin,
thanks for the offer, but I managed to work around the 500 error. I still don’t know where it came from but after a fresh install of WP, and Role Scoper being the first plugin to activate, it works like a charm.

On the old installation, I have been experimenting with another role managing plugin and WP Members, maybe they messed up the database so that even after they were deactivated, Role Scoper ran into some problems.

Thanks again, great work! Keep it up
Robert

Comment from rob cain
Time: July 18, 2008, 4:48 pm

Hi,

Firstly I would like to say - great plug-in! - really well conceived design approach - its rare to find software developers taking a ‘proper’ and ‘usable’ view of access control features; but you certainly seem to have.

i think that this app, together with the user roles and capabilities plug-in role_manager should be incorporated into WP Core - its that important for a bona fide cms.

One slight bug I’ve found so far:

Upon logging on as Admin and Creating/Editing a new Page and assigning ‘Readers’, ‘Groups’ , [WP Subscribers], and then Saving, then I get presented with an ‘un-styled’ view of the same admin page, plus the following mesage at the bottom of the page:

‘Warning: Cannot modify header information - headers already sent by (output started at /home/fhlinux171/s/systemcore-epublishing.co.uk/user/htdocs/wordpress/
wp-content/plugins/role-scoper/admin/filters-admin_rs.php:675) in /home/fhlinux171/s/systemcore-epublishing.co.uk/user/htdocs/wordpress/
wp-includes/pluggable.php on line 770′

I haven’t tested thoroughly yet, nor traced it, but it looks like a fairly simple bug to fix.

Any thoughts?

Comment from j.verhine
Time: July 20, 2008, 8:55 pm

Rob, Check three comments above yours.

- -

I noticed a new problem with 2.6. I cannot edit groups, edit members, or click the name within object role assignments without forcing a login screen that won’t process the login - it just keeps refreshing. Is this being experienced by anyone but me?

Love the job you’ve done kevin.

Comment from j.verhine
Time: July 20, 2008, 10:33 pm

I found out the problem. All of the links I mentioned (as well as the submit buttons) all reference domain.com//wp-admin… so it’s adding a double slash instead of a single one.

Comment from j.verhine
Time: July 20, 2008, 10:37 pm

Sorry, again for another post. I noticed you made updates today. You rock!!!

Pingback from WordPress Plugins: Role Scoper at WordPress Today
Time: July 22, 2008, 12:28 am

[...]   Role Scoper,提供一个快速、详细的用户权限分配界面。   WordPress的用户权限管理部分从来都是模糊不清和配置困难,本插件提供一个更加明确的权限配置界面,支持对多个用于应用规则。这个插件很适合共笔的Blog。 [...]

Comment from Kevin
Time: July 22, 2008, 10:50 pm

Rob, that bug that caused the funky styling and PHP warning on page save is fixed now.

Comment from Darrell
Time: July 23, 2008, 1:03 pm

I am having some issue setting this up properly.

I have a site with many pages and several categories.

I want to add an author, but only give him access in the control panel to publish to a subcaategory.

I thought i had set it up properly, but when I tested it, the control panel showed all categories and let me publish to any of them I liked.

How do I go about setting this up properly?

Excellent plugin by the way.

Comment from Kevin
Time: July 24, 2008, 6:52 pm

Darrell,

I just answered this question in a forum post.

You should also check the release notes for 0.9.27.

Comment from Found By Design
Time: July 26, 2008, 1:46 pm

I would like to restrict certain users from being able to select a page template when they post. It would be great if those specific page templates did not even show when they created a page, but would show the permitted ones. Is this something that this plugin could be modified to handle?
Thanks, Ed

Comment from Arnold Young
Time: July 28, 2008, 12:22 am

Kevin - I have a usage question. Before I get excited - could you please tell me if I can use this plugin to control a wp website based on Pages only (not blogs) to allow or restrict viewing/access of menu options(Pages) or page content based on a login via a membership plugin like amember, where each member is tied to one of the roles in wp and each page is designated an access level tied to roles? Please say yes! I am using wpremix2 themes and have hidepost and rolemanager activated - but am searching for a solution and this may be it. These are users not wp content contributors so it just is to read pages and access links and content on those pages.

Thanks - Arnold

Comment from Arnold Young
Time: July 28, 2008, 4:05 am

Hi Kevin - I am on WP 2.6. I installed role scoper and I see under Write, Post, Advanced Options - Readers, Contributors, and Editors - but in Write, Page, I do not see these under Advanced Options, but rather under the Select Template under the WP Remix 2 Add Template File category just above the Advanced Options. So for some reason there is a code conflict - http://www.wpremix.com — it shows Readers, Contributors, Editors, and Associates.

Thanks - this plug in looks really cool - but this situation is stopping the use of it. I reported this situation on the WPRemix Theme forum also - but stated that your plugin is powerful and can extend his powerful Theme system by a lot if I think I what I see is so. But I could not try it because of the conflict.

Thanks

Pingback from 10 brand-new & promising WordPress Plugins | Beeex.net
Time: July 28, 2008, 1:31 pm

[...] to the Role Scoper plugin here, the download link is on the page. Role Scoper is a plugin that enables and enhances the [...]

Pingback from 10 excellent & promising WordPress Plugins, some brand-new | Beeex.net
Time: July 28, 2008, 1:34 pm

[...] to the Role Scoper plugin here, the download link is on the page. Role Scoper is a plugin that enables and enhances the [...]

Comment from Kevin
Time: July 28, 2008, 5:46 pm

Arnold,

The conflict stems from the absence in the WP core of a hook (dbx_page_advanced) for inserting custom entries under “Advanced Options”. It was present through WP 2.3, then dropped and I haven’t taken up the cause with the WP core team yet. Instead I make use of another hook (theme_root) which normally fires at the desired time. Apparantly WP Remix makes it fire earlier.

I have a workaround in mind, but since WP Remix is a paid product and I don’t have a copy, please let me know if this works. In plugins/role-scoper/admin/filters-admin_rs.php, replace function flt_theme_root with the following:

	function flt_theme_root($path) {
		if ( awp_ver("2.5") && empty($_POST) ) {
			if ( ! strpos($_SERVER["REQUEST_URI"], "wp-admin/page.php") &&
! strpos($_SERVER["REQUEST_URI"], "wp-admin/page-new.php") )
				return $path;

			global $wp_current_filter;
			if ( ! isset($wp_current_filter) || ! is_array($wp_current_filter) ||
! in_array("theme_root", $wp_current_filter) )
				return $path;

			if ( ! did_action("edit_page_form") || did_action("rs_page_advanced") )
				return $path;

			$setargs = array( "is_global" => true );
			awp_force_set("wp_filter", array(), $setargs, "rs_page_advanced", 10);
			do_action( "rs_page_advanced" );
		}
		return $path;
	}

Comment from Mariusz
Time: July 28, 2008, 8:31 pm

Hi,
Great plugin, thank you.

I have one question: I would like to use your plugin to restrict some categories to some groups of users. If some one logs in he should see all unrestriced posts/categories plus his own. It works fine. But where user is not logged in as any role he can see all, and I want to hide some groups for him.

Is it possible?

Thanks,
Mariusz

Comment from Arnold Young
Time: July 28, 2008, 9:02 pm

Thank Kevin - I was making the change and then tried to launch WP then I got a 500-internal-server error — so I am trying to recover and get WP to work so I can test this code. I will let you know as soon as I am back up again. Maybe the .htaccess file got corrupted? Not sure yet.

Comment from Arnold Young
Time: July 28, 2008, 9:12 pm

nope - can’t even find a .htaccess file — still searching - sorry i really wanted to test that right away.

Comment from Kevin
Time: July 28, 2008, 9:14 pm

Mariusz,

Yes, you can limit read access by category. I describe that in the Usage Guide.

Comment from Kevin
Time: July 29, 2008, 8:56 am

Okay, thanks to Arnold’s cooperation I tracked down the WP Remix conflict. This was my fault for not noticing the do_meta_boxes action introduced in WP 2.5

In plugins/role-scoper/admin/filters-admin, change

add_filter("theme_root"

to

add_filter("do_meta_boxes"

and function flt_theme_root to:

  function flt_theme_root($path) {
          if ( awp_ver("2.5") && empty($_POST) ) {
              if ( ! strpos($_SERVER["REQUEST_URI"], "wp-admin/page.php") &&
 ! strpos($_SERVER["REQUEST_URI"], "wp-admin/page-new.php") )
                  return $path;

              if ( ! did_action("edit_page_form") ||
 did_action("rs_page_advanced") )
                  return $path;

              $setargs = array( "is_global" => true );
              awp_force_set("wp_filter", array(), $setargs,
 "rs_page_advanced", 10);
              do_action( "rs_page_advanced" );
          }
          return $path;
      }

Comment from Arnold Young
Time: July 29, 2008, 9:45 am

Kevin - - that shows correctly now for Pages! Thanks for your quick response in fixing this situation. I am excited to use your comprehensive plugin.

Comment from Mariusz
Time: July 30, 2008, 4:59 am

Hi Kevin,

I managed to set up categories and roles for them. Now when I log in as ‘footballer’ I can see only his categories. But when I’m not logged in I can see all categories and I should see none. Is it possible to do?

Comment from Mariusz
Time: July 30, 2008, 5:11 am

To avoid unlogged users seeing all I set posts to private. But role ‘teacher’ can see private posts of ‘footballers’ even If in setup he should see only his category.

And when post are private and I set ‘footballers’ to see them, their category is not listed on the side bar. Am I doing something wrong or plugin doesn’t have capabilities I need?

Comment from Arnold Young
Time: August 1, 2008, 12:21 am

Kevin - trying to understand how to control granting or denying access to a page and page content without putting each member/user in the WordPress user list. Is there are way to just use the role user level value linked to my member in my membership database?

Comment from Kevin
Time: August 1, 2008, 10:14 am

@Mariusz - did you set Exclusive Section Roles for those categories?

Comment from Kevin
Time: August 1, 2008, 10:22 am

@Arnold - I’m not sure what you mean by role user level. Is that something aMember introduces - maybe using the deprecated WordPress numeric user level which preceded the roles system? I’m going to look into aMember today or Monday.

Comment from Jessica
Time: August 4, 2008, 5:34 pm

Dear Kevin!

Thank you so much for your effort and this wonderful plugin!! :-)
I’ve been using the Disclose Secrets plugin for a while, but since it has not been updated for a long time and I wanted to update my WordPress, I’m now using yours. It was quite a piece of work to edit all the old entries but it’s worth it. I could not blog without your plugin because I just want certain people to read private things. Honestly, I don’t know why a feature like this still isn’t part of the WP core?!
Please keep up the good work! :-)

I have also a question: Is it possible to turn off the text in the user’s profile that shows to himself in which groups he is a member and the list of posts he can read because of that? The list can become quite big and I don’t want the users to see to which group they belong to. I don’t want anyone to get offended by recognizing that he cannot read the super confidential things. ;)

Greetings from Germany!

Comment from Kevin
Time: August 4, 2008, 8:41 pm

Jessica,

Glad to hear it’s working well for you. Thanks for the encouraging words; I do enjoy all the overseas acquaintances Role Scoper has brought me.

There is currently no option available to hide that info. However, you can force it by editing admin/filters-admin_rs.php as follows:

add the following code to the top of the functions ui_user_groups and ui_user_roles, just after the opening {

if ( strpos( $_SERVER["REQUEST_URI"], "profile.php") && ! is_administrator_rs() )
   return;

Comment from Jessica
Time: August 5, 2008, 5:12 pm

Hello Kevin!
Thanks for your quick reply! :-)
It works! Thank you so much. :-)

Pingback from 2008 Plugin Competition Review, Part 2 of 2 « planetOzh
Time: August 8, 2008, 11:14 am

[...] Role Scoper lets you define roles and groups to manage privileges amongst several users This seems to be a very ambitious plugin that will seriously help multi user blogs. To be honest I didn’t test it and gave a quick glance at the code, which looked clean and very well commented, but this is obviously not a plugin you can really judge in a few minutes. What I did like though, and hence this mini review despite my lack of insightful comments, is the explanations, their content and their tone. Very well put, clear, detailed but not overwhelming. Or maybe it’s just that this plugin rang some bell in me? I’m pretty sure that this plugin will be something I’ll remember and point to when I get questions about role managing. [...]

Pingback from Events-Calendar 6.5 The last version | Heirem’s
Time: August 18, 2008, 4:11 am

[...] Moving a line in ec_js.class.php:5 to place it in the class EC_JS(). Problem reported by Maida, whom I thank very much, for compatibility with the plugin Role Scoper. Solution provided by the author of Role Scoper. [...]

Pingback from Admin Drop Down Menu: More Goodness & an API « planetOzh
Time: August 20, 2008, 8:47 pm

[...] to write dirty patches, just throw some add_filters() in (hat tip to Kevin Behrens and his plugin Role Scoper for inspiring [...]

Pingback from links for 2008-08-24 | hansi.unblogged
Time: August 25, 2008, 1:03 am

[...] Role Scoper Plugin for Wordpress | Agapetry WordPress: Capabilities, Roles and Wish Lists Whenever you access a WordPress site, the software considers what you are trying to do: read a post, edit a page, manage categories. Most sites allow you to read posts and pages without logging in. Any other operation you may request is permitted only if your user definition (as identified by login name and password) includes a corresponding capability. [...]

Pingback from Excellent membership management plugin | subjectverbobject
Time: August 25, 2008, 6:56 am

[...] the Role Scoper plugin, by Kevin Behrens. It’s still in development, but it offers the level of control my client is [...]

Comment from Jessica
Time: September 5, 2008, 5:34 am

Hi Kevin!

I’m afraid I have to bother you with another question. ;)

Since WP 2.6 I’m using the tagging system of WordPress itself instead of Simple tagging. By now, the tagcloud just displays the tags used in public posts, those of private posts are ignored even if I’m logged in.

I wonder if it is possible to make wp_tag_cloud / wp_generate_tag_cloud work with your plugin so that the tagcloud displays the tags of all posts the current user is allowed to see due to your plugin.
That would be pretty cool. :-)

(Simple Tagging and Disclose Secrets for some reason just did that, but I do not want to switch back to one of those plugins.)

Greetings,

Jessica

Comment from Todd Lambert
Time: September 17, 2008, 8:14 pm

Hi Kevin, thanks for your awesome plugin… it’s sorely missing from WP.

I’ve run into a few snags with the plugin, not sure what is causing it.

I had it installed and working, and was clicking on some of the options for it, when it completely killed my site. Both backend and front went down.

I removed the role scoper folder from the plugins folder, and it came back ok. But everytime I add it back, it takes the site down.

I then went in and deleted all of the tables that were related to RS… and again the blog came back working.

However, as soon as I upload the RS folder and try and activate it, it crashes everything again. Looking at the values in the datasbase, it appears that there is data from the previous install in the new tables created when activating the plugin. How can that be? I dropped the tables!

The tables for this plugin are:
wp_user2role2object_rs
wp_user2group_rs
wp_role_scope_rs
wp_groups_rs

Are there any others or data put somewhere that I am missing?
Help, I can’t seem to get this functionality back up and working.

This is on 2.6.2
Can reproduce with any or none of the other plugins I’m using:

Cimy User Extra Fields
Role Manager
Page Category Plus

Comment from Kevin
Time: September 18, 2008, 9:47 am

Todd,

Role Scoper also maintains a cache of the role settings in wp-content/cache. A corruption of that cache may or may not be the cause of your problem. For diagnostic purposes, please zip the cache folder and mail me a copy (I’ll send you my address). Then to return to a clean slate, delete the contents of wp-content/cache.

I can’t imagine any scenario where cached values would be reinstated in newly created db tables on plugin activation. Did only certain data/tables seem to be carried over, or pretty much everything?

Let me know if you can remember which options you set just before the site crashed.

Comment from Jocuri
Time: September 22, 2008, 12:55 am

It works! Thank you so much

Comment from matt
Time: September 22, 2008, 2:42 pm

wow this plugin looks to be exactly what i want. i installed but i’ll be honest i’m too scared to flicking switches and buttons incase i screw my blog up.

i have quite a simple user case scenario that i want to set up for just adding new authors and then setting what new authors (and therefore existing authors) can do.

is there anyone out there who can help me?

Comment from Kevin
Time: September 22, 2008, 6:22 pm

You can disregard most of the Options and Realm settings, as the defaults will work well for most installations. Beyond that, please see the Usage Guide. I’m working an a revision with an improved administrative interface (more inline help, more intuitive menu and form layout, better bulk editing). Unless you have a question on a specific point that’s not covered in the Guide, we’re probably both better off having me focus on getting the friendlier version out.

Pingback from FOR WORDPRESS - New Wordpress Plugin Releases
Time: September 22, 2008, 9:25 pm

[...] Role Scoper [...]

Comment from Kevin
Time: September 26, 2008, 1:41 pm

Todd Lambert just reported via e-mail that his installation is now working after dropping Role Scoper’s tables again and re-installing.

Pingback from WordCast 29: I’m Your Fairy Blogmother! | WordCast
Time: September 30, 2008, 12:59 am

[...] Dave’s pick: Role Scoper Plugin [...]

Pingback from WordCast 29: I’m Your Fairy Blogmother! - Dave Moyer
Time: September 30, 2008, 11:55 pm

[...] Dave’s pick: Role Scoper Plugin [...]

Comment from Joost
Time: October 9, 2008, 11:42 am

Well, this module seems to solve a lot of problems for us. But I don’t seem to get it exactly how I want it. For instance, using the author-group as a basis I want to restrict access to that group, only allowing it to post to one category.

I managed to do that, by first revoking rights, and then assign a Section Role of Post Author to “author”.

But now it is not possible anymore for an author to edit their own posts. When I change the section role editor, it suddenly gets the right to edit ALL posts in that category (and when the user posts, he will post as “admin”).

I want a mixture of those two situations (able to post and edit own posts).

What am I missing here?

Comment from Matt K
Time: October 15, 2008, 11:42 pm

Great plugin. The detail is amazing. I am, however, having a problem. After install I am getting the following error:

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /html/blog/wp-content/plugins/role-scoper/admin/admin-bulk_rs.php on line 49

Warning: in_array() [function.in-array]: Wrong datatype for second argument in /html/blog/wp-content/plugins/role-scoper/admin/admin-bulk_rs.php on line 51

Unfortunately this issue is severe enough that it is preventing my page restriction from working. Any ideas what this code be or is it likely some conflict on my end?

Pingback from New Wordpress Plugin Releases : Free Web Template | Free Script
Time: October 22, 2008, 2:21 pm

[...] Role Scoper [...]

Comment from Hoib
Time: October 29, 2008, 10:31 pm

If I have a series of pages for public consumption and members consumption but then a series of 5 additional pages for members only, does RS give me the ability to password the members only as a “section”? IOW, I’d like a Member’s Only Log In as the parent and the 5 additional pages as the children to be displayed on the sidebar ONLY after the password is entered. The problem now is that the 5 child pages show up in the sidebar even though they’re underneath the passworded parent.

Is this what RS does? I want to know before going through a lot of work for nothing, please.

Thanks.

Pingback from spielwiese. » Blog Archive » clean-up.
Time: October 30, 2008, 4:52 pm

[...] after playing around in the last days a bit, it seems that my goals can be partially resolved using role scoper. well, not perfectly, but at least to some extend. (so there’s still the need to write the [...]

Comment from Kevin
Time: October 31, 2008, 12:14 pm

Hoib,

Role Scoper would allow you to hide a page (and its subpages if you so choose), displaying it only to users you specifiy. Menu links visibility follows page readability.

It does sound like there’s one area where we’re “not on the same page”: RS Roles (in your case, to make a restricted post/page readable) are based on a user login/password, NOT a page-specific password.

Comment from puela
Time: November 5, 2008, 1:33 am

Hello Kevin,
Thanks for the great plugin, but I’m getting this error.
“wp-content/plugins/role-scoper/hardway/cache-persistent.php on line 35″
I’m pretty new at all this. Any help would be greatly appreciate it.
Thanks in advance.
Puela

Comment from rcain
Time: November 7, 2008, 8:16 am

Hi, congrats and thanks for this excellent plugin.

I haven’t tried it out fully yet (there’s a lot to it), but i am pretty confident it should cover most future access control requirements i might come across.

question: should it work with wordpress mu?

i am aware that role_manager plugin http://www.im-web-gefunden.de/wordpress-plugins/role-manager/ isnt yet formally supported on mu, however i think i have the two ’sort of working’ together in an mu environment - alongside a hacked version of the ‘More-Privacy-Options’ plugin - http://wpmudev.org/project/More-Privacy-Options.

i am interested in working with others to produce a stable solution based around this config. can you (or anyone else) offer any further advise/guidance/experience in this direction?

thanks again

Comment from Kevin
Time: November 7, 2008, 6:59 pm

In very brief trials, I have found Role Scoper to function normally when installed for any individual blog on a mu site. You will have a separate Role Scoper configuration for each blog. However, all site users are available for role assignment without the need to register them on the specific blog.

Comment from Rob
Time: November 10, 2008, 5:09 am

Hi Kevin,

Amazing plugin - kudos to you!

Not sure if I am doing something wrong (or misunderstanding the use of the plugin), but I cannot get post specific restrictions to work. Category works great.

So, having no other restrictions set, I go to Restrictions > Posts and set a default Post reader restriction. If I then look at an individual post, I see Readers - restricted role in advanced options, but I can still see post in the blog when not logged in.

If I set a group (eg administrator) for that individual post, I see Readers (restricted role, 1 group), but post still visible when not logged in.

I have to set the individual post to ‘Private’ to hide it from not-logged in visitors, or set a category restriction.

Cheers
Rob

Comment from Rob
Time: November 10, 2008, 5:59 am

(sorry, I posted comment before seeing the forum link)

Pingback from 35 Tips Tricks To Manage and Handle Multi-Author Blogs | Wordpress
Time: November 10, 2008, 6:14 am

[...] Similar plugins: Role Scoper [...]

Pingback from Wordpress Blog Services - 35 Tips Tricks To Manage and Handle Multi-Author Blogs
Time: November 10, 2008, 11:54 am

[...] Similar plugins: Role Scoper [...]

Pingback from Wordpress Management Plugins | ULTRABILISIM
Time: November 13, 2008, 8:18 am

[...] Similar plugins: Role Scoper [...]

Pingback from 35 Tips Tricks To Manage and Handle Multi-Author Blogs
Time: November 14, 2008, 11:46 pm

[...] Similar plugins: Role Scoper [...]

Pingback from How does People Online turn WordPress into a servicable CMS? | subjectverbobject
Time: November 15, 2008, 6:44 am

[...] are a lot of other great WordPress plugins out there that we use occasionally. Role-scoper, which I talked about here is one, as is StatPress Reloaded, which we use because some clients find [...]

Comment from James
Time: November 17, 2008, 8:55 am

Thanks for an excellent plugin Kevin!

I am still trying to find my way around the complexities of various roles and permissions and wondered if you could answer a quick question for me?

I have a post role called ‘Private Post Readers’ granting access to premium posts. I used the ‘Hidden Content Teaser’ window to add a suffixed (p) graphic to appear after Premium posts for anonymous users. However when I am logged out (ie: anonymous) and look at the recent posts list all the posts whether premium or not are marked with the (p) graphic.

Any idea what I am doing wrong?

Thanks again for the excellent plugin.

James

Comment from Kevin
Time: November 17, 2008, 11:29 am

James,

By “recent posts list”, do you mean a sidebar list or the main WP posts list?

What makes your posts premium or non-premium? Are some (or all?) set private by WP? Set as restricted (directly or via category / default restriction) by Role Scoper? Any of these would cause the hidden content teaser to jump in on the anon user.

Write a comment

(But if your comment is a usage question, bug report or feature request, please post it in the Support Forum instead.)