Resources

My Agape try

Your Agape try


Support Forum

You must be logged in to post Login Register

Search 
Search Forums:


 




Allowing user to edit their published post but not edit post comments

UserPost

4:38 pm
May 7, 2009


asechrest

Member

posts 2

1

Hi,

I've done some experimentation with Role Scoper (and Role Manager) and I haven't been able to achieve a certain functionality.  I'd like to allow a user to publish their own post AND edit that published post, but RESTRICT the right to edit comments to their published post.

I've been able to easily allow users to publish their own post and to then edit that published post, but allowing them to edit the published post seems to always include the capability to edit comments to that post, no matter whether they are the comment author or not.

In short: I'd like a user to be able to edit his/her published post without also being able to edit others' comments to that post.

Role Scoper is complex, have I just missed the ability to do this with the plugin?

Thanks much.

8:22 pm
May 11, 2009


Kevin

Admin

posts 2503

2

asechrest said:

Hi,

In short: I'd like a user to be able to edit his/her published post without also being able to edit others' comments to that post.


Good point. This was a design flaw on my part, but easily remedied. I will include the following change (to plugins/role-scoper/defaults_rs.php) in the next release.

change:

'moderate_comments' => (object) array( 'src_name' => 'post', 'object_type' => ", 'op_type' => ", 'owner_privilege' => true ),

to:

'moderate_comments' => (object) array( 'src_name' => 'post', 'object_type' => ", 'op_type' => " ),

Any votes on whether I should make this behavior adjustable via Role Scoper Options (or via a wp-config define statement)?

8:50 am
May 13, 2009


asechrest

Member

posts 2

3

Nice!  In the meantime I can make the change myself as well.

This is a feature that I've struggled to find since I started trying to set up multi-author WordPress sites.  Devs running sites with user-generated diaries would often desire that users can publish and update a post but not freely moderate or delete the community feedback (comments) to that post.

I could also see where devs would want  users to moderate comments on their posts too, so maybe adjustable is good.

Can't thank you enough for this change.  Going to have to blog about it since yours is the only plugin I know of to offer this functionality now.

8:17 am
June 14, 2011


doran

Member

posts 13

4

Hi Kevin,

is it currently supposed to be the default behavior that users cannot edit comments on their own posts?

If so, It doesn't seem to work in my setup:

Users here are by default contributors and member of the group "newsauthors". This group has a category role of "post author" for the category "news".

My users are allowed to publish posts, but I don't want them to be able to moderate any comments or to receive any comment moderation emails.

However, when someone writes a comment to a user's post, this user receives a comment moderation email and it is also possible for this user to approve the comment via the link in the email.

On the other hand, this user cannot see any comments to moderate at the list view in the backend. Hope you can help.

10:20 am
June 16, 2011


Kevin

Admin

posts 2503

5

doran,

Make sure the "moderate comments" capability is included in Roles > Options > RS Role Defs > Post Author.

If that doesn't solve your issue, I'll look into it after returning from vacation next week.

3:23 am
June 17, 2011


doran

Member

posts 13

6

Hi Kevin,

is it possible that you missunderstood my question? Your suggestion sounds as it would resolve the "issue" that the user doesn't see the comment list in the backend, but that behavior is absolutly ok in this case. I only mentioned it to give you the whole story.

As mentioned befor, the real problem is:

My users are allowed to publish posts, but I do *not* want them to be able to moderate any comments or to receive any comment moderation emails.

Anyway thanks for your answer, and I wish you a nice vacation:)


1:10 pm
June 22, 2011


Kevin

Admin

posts 2503

7

doran said:

My users are allowed to publish posts, but I do *not* want them to be able to moderate any comments or to receive any comment moderation emails.


Commenting permission is based on the moderate_comments capability.

In your case, make sure neither their WP role nor any assigned RS role contains that capability. See Roles > Options > RS Role Defs.

8:34 am
July 4, 2011


doran

Member

posts 13

8

Kevin said:

  Commenting permission is based on the moderate_comments capability.

In your case, make sure neither their WP role nor any assigned RS role contains that capability. See Roles > Options > RS Role Defs.


I already had looked for that:

The WP role is Contributor. In Roles > Options > WP Role Definitions, "Moderate Comments" is not assigned for Contributors.

The maximum RS role such a user has (via category roles of a rs group the user belongs to) is "Post Author". In Roles > Options > RS Role Definitions, "Moderate Comments" is not assigned for Post Authors.

9:18 pm
August 4, 2011


Kevin

Admin

posts 2503

9

This is fixed in the updated Role Scoper development code (1.3.45-beta):

  • Fixed : Comments were editable / approvable by any user who could edit the associated post, regardless of moderate_comments capability

Thanks for reporting.

6:34 am
August 26, 2011


doran

Member

posts 13

10

Is it possible that this fix didn't make it in 1.3.46? Or maybe this is another associated bug with comment moderation emails:

- Make a fresh install of wordpress
- Install Role Scoper 1.3.46
- Create a user "testuser" with a wordpress role of author
- Create a group "news"
- Log in with the testuser account and post an article in the "news" category
- While not logged in, comment on that article
-> The blog owner gets a comment moderation email. User "testuser" dows NOT get a comment moderation email, which ist perfectly fine.

- Now, change the wordpress role of "testuser" to contributor
- In Users/Role Groups, create a group "newsposters" and assign "testuser" to that group
- In Roles/Categorys, assign the role "Post Author" in the category "news" to the Group "newsposters" (Confirm yourself that in Roles/Options/RS Role Definitions, "Moderate Comments" is DISABLED)
- While not logged in, comment on the same article as before
-> The blog owner gets a comment moderation email. User "testuser" ALSO gets comment moderation (which is not what we want).

8:17 am
August 26, 2011


Kevin

Admin

posts 2503

11

The bug fix was for the actual editability of comments without the moderate_comments capability. I was not looking at the comment moderation email.

Make sure "moderate_comments" is not in your WP Contributor role definition, nor in any General Roles assigned to the user or group.

8:36 am
August 26, 2011


doran

Member

posts 13

12

Kevin said:

Make sure "moderate_comments" is not in your WP Contributor role definition, nor in any General Roles assigned to the user or group.


Hi Kevin,

I can find "moderate_comments" activated only for editors or administrators - nowhere else.

I tested all this with a fresh install where role scoper was the only ever activated plugin and absolutely no changes in "Role Scoper Options", and only those steps I described in my last post. So this should be easy to reproduce.

9:18 am
August 26, 2011


Kevin

Admin

posts 2503

13

This actually stems from a WP bug. I've included a workaround in the updated Role Scoper development code.

2:39 am
August 29, 2011


doran

Member

posts 13

14

It now works perfectly.

Thanks a lot!


About the Agapetry forum

Currently Online:

15 Guests

Maximum Online: 150

Forums:

Groups: 2

Forums: 7

Topics: 1245

Posts: 5653

Members:

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