Plugin Directory

Role Scoper

CMS-like permissions for reading and editing. Content-specific restrictions and roles supplement/override WordPress roles. User groups optional.

Download Version 1.3.54

Documentation

  • A slightly outdated Usage Guide is available. It includes both an overview of the permissions model and a How-To section with step by step directions. Volunteer contributions to expand, revise or reformat this document are welcome.
  • Role Scoper's menus, onscreen captions and inline descriptive footnotes can be translated using poEdit. I will gladly include any user-contributed languages!.

Plugin Compatibility Issues

WP Super Cache : set WPSC option to disable caching for logged users (unless you only use Role Scoper to customize editing access).

WPML Multilingual CMS : plugin creates a separate post / page / category for each translation. Role Scoper does not automatically synchronize role assignments or restrictions for new translations, but they can be set manually by an Administrator.

QTranslate : Role Scoper ensures compatibility by disabling the caching of page and category listings. To enable caching, change QTranslate get_pages and get_terms filter priority to 2 or higher, then add the following line to wp-config.php: define('SCOPER_QTRANSLATE_COMPAT', true);

Get Recent Comments : not compatible due to direct database query. Use WP Recent Comments widget instead.

The Events Calendar : Not compatible as of TEV 1.6.3. For unofficial workaround, change the-events-calendar.class.php as follows :

change:

add_filter( 'posts_join', array( $this, 'events_search_join' ) );
add_filter( 'posts_where', array( $this, 'events_search_where' ) );
add_filter( 'posts_orderby',array( $this, 'events_search_orderby' ) );
add_filter( 'posts_fields', array( $this, 'events_search_fields' ) );
add_filter( 'post_limits', array( $this, 'events_search_limits' ) );

to:

if( ! is_admin() ) {
  add_filter( 'posts_join', array( $this, 'events_search_join' ) );
  add_filter( 'posts_where', array( $this, 'events_search_where' ) );
  add_filter( 'posts_orderby',array( $this, 'events_search_orderby' ) );
  add_filter( 'posts_fields',   array( $this, 'events_search_fields' ) );
  add_filter( 'post_limits', array( $this, 'events_search_limits' ) );
}

PHP Execution : as of v1.0.0, mechanism to limit editing based on post author capabilities is inherently incompatible w/ Role Scoper. Edit php-execution-plugin/includes/class.php_execution.php as follows :

change:

add_filter('user_has_cap', array(&$this,'action_user_has_cap'),10,3);

to:

add_filter( 'map_meta_cap', array( &$this,'map_meta_cap' ), 10, 4 );

replace function action_user_has_cap with :

function map_meta_cap( $caps, $meta_cap, $user_id, $args ) {
    $object_id = ( is_array($args) ) ? $args[0] : $args;
    if ( ! $post = get_post( $object_id ) )
        return $caps;

    if ( function_exists( 'get_post_type_object' ) ) {
        $type_obj = get_post_type_object( $post->post_type );
        $is_edit_cap = ( ( $type_obj->cap->edit_post == $meta_cap ) && in_array( $type_obj->cap->edit_others_posts, $caps ) );
    } else {
        $is_edit_cap = in_array( $meta_cap, array( 'edit_post', 'edit_page' ) ) && array_intersect( $caps, array( 'edit_others_posts', 'edit_others_pages' ) );
    }

    if ( $is_edit_cap ) {
        $id = $post->post_author;

        if ( isset( $this->cap_cache[$id] ) ) {
            $author_can_exec_php = $this->cap_cache[$id];
        } else {
            $author = new WP_User($id);
            $author_can_exec_php = ! empty( $author->allcaps[PHP_EXECUTION_CAPABILITY] );
            $this->cap_cache[$id] = $author_can_exec_php;
        }

        if ( $author_can_exec_php ) 
            $caps []= PHP_EXECUTION_CAPABILITY;
    }

    return $caps;   
}

Attachment Filtering

Read access to uploaded file attachments is normally filtered to match post/page access.

To disable this attachment filtering, disable the option in Roles > Options or copy the following line to wp-config.php: define('DISABLE_ATTACHMENT_FILTERING', true);

To reinstate attachment filtering, remove the definition from wp-config.php and re-enable File Filtering via Roles > Options.

To fail with a null response when file access is denied (no WP 404 screen, but still includes a 404 in response header), copy the folling line to wp-config.php:

define ('SCOPER_QUIET_FILE_404', true);

Normally, files which are in the uploads directory but have no post/page attachment will not be blocked. To block such files, copy the following line to wp-config.php:

define('SCOPER_BLOCK_UNATTACHED_UPLOADS', true);

Hidden Content Teaser

The Hidden Content Teaser may be configured to display the first X characters of a post/page if no excerpt or more tag is available.

To specify the number of characters (default is 50), copy the following line to wp-config.php:

define('SCOPER_TEASER_NUM_CHARS', 100); // set to any number of your choice

Requires: 3.0 or higher
Compatible up to: 3.3.1
Last Updated: 2012-2-10 Downloads: 206,229

Average Rating

5 stars
4 stars
3 stars
2 stars
1 star
(112 ratings)

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.

Log in to vote.

33,3,1
100,4,4
83,6,5 100,1,1
100,2,2 0,1,0
100,6,6 80,5,4 0,1,0 67,3,2 100,1,1 100,1,1 100,1,1
100,1,1 90,20,18 75,4,3 100,2,2 100,1,1
100,3,3 100,3,3 100,5,5 100,1,1
67,18,12 100,1,1 100,1,1 100,2,2
100,1,1 100,1,1
100,1,1 100,2,2
100,1,1 0,1,0 100,6,6 100,4,4 0,1,0
100,1,1 50,4,2 100,1,1
50,2,1 0,1,0
100,2,2 100,1,1 100,1,1
100,1,1 100,1,1
100,1,1
100,1,1 100,1,1 100,2,2 100,8,8 100,1,1 100,1,1 100,1,1
100,2,2
67,3,2 100,2,2 100,1,1