Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Unable to Preview Posts

UserPost

5:14 am
September 29, 2008


Daisy

Member

posts 35

1

I've been having a problem with Role Scoper limiting the ability for Editor and Contributor users to preview posts.  Since admins were able to preview posts I used the Role Manager plugin to attempt to issolate the role that makes it possible to preview.

Strangely the role that enables this is "activate plugins" I certainly don't want my editors and contributors having access to this portion of the site!

Any thoughts on this problem? The message recieved when a user without the activate plugins role attempts to preview an unpublished post is:

"Sorry, no posts matched your criteria."

8:39 am
September 29, 2008


Kevin

Admin

posts 2503

2

Thanks for reporting this bug.  I have corrected the code for the upcoming release.  Until then, please modify plugins/role-scoper/defaults_rs.php as follows:

add:

    if ( ! empty($_GET['preview']) ) {
        $arr[$name]->reqd_caps['read']['post'] = array ( 'draft' => array('edit_others_posts'), 'pending' => array('edit_others_posts'), 'future' => array('edit_others_posts') );
        $arr[$name]->reqd_caps['read']['page'] = array ( 'draft' => array('edit_others_pages'), 'pending' => array('edit_others_pages'), 'future' => array('edit_others_pages') );
    }

just before:

/* Post data source and others following the "save_{src_name}", etc. pattern

Previously (due to this bug), only administrators could preview posts. Role Scoper defines an administrator as any user with the activate_plugins capability — if you can activate plugins, you can do anything :)

11:37 am
September 29, 2008


Daisy

Member

posts 35

3

What a lifesaving fix! Thanks.

2:39 pm
September 29, 2008


Daisy

Member

posts 35

4

I tried the fix and it does not seem to have helped. Both contributor and editor are unable to view the preview.

I have exlusive section rules applied and a group set to be editor and a group set to be contributor for a single category.

Is it possible that I have something set incorrectly?  I really need this to work!! LOL

blog role honored
blog role honored
blog role ignored
blog role ignored
blog role ignored
blog role ignored

10:45 pm
September 29, 2008


Kevin

Admin

posts 2503

5

The code snippet I quoted in the previous post was missing one line. Here is the updated patch:

if ( ! empty($_GET['preview']) ) {   $arr['post']->usage->statuses->access_type['front'] = array( 'draft', 'pending', 'future' ) + $arr['post']->usage->statuses->access_type['front'];   $arr['post']->reqd_caps['read']['post'] = array ( 'draft' => array('edit_others_posts'), 'pending' => array('edit_others_posts'), 'future' => array('edit_others_posts') ) + $arr['post']->reqd_caps['read']['post'];   $arr['post']->reqd_caps['read']['page'] = array ( 'draft' => array('edit_others_pages'), 'pending' => array('edit_others_pages'), 'future' => array('edit_others_pages') ) + $arr['post']->reqd_caps['read']['page']; }

just before:

/* Post data source and others following the "save_{src_name}", etc. pattern

6:02 am
September 30, 2008


Daisy

Member

posts 35

6

This appears to have worked. Thanks so much for your work!


About the Agapetry forum

Currently Online:

16 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1249

Posts: 5659

Members:

There are 1261 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