-
Notifications
You must be signed in to change notification settings - Fork 82
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
User cannot edit their own Questions, Answers and Comments #238
Comments
Fix included here involves: 1) passing in the commentid; 2) using the commentid in place of the postid for the comment author check; and; 3) initialising the postid used in the author question/answer author check when it is not passed in. See issue designwall#238 for details.
Fix included here involves: 1) passing in the postid/commentid. See issue designwall#238 for details.
Hi timhibberd, |
For comments I have solved this issue checking if the current user is the comment author: file: /templates/content-comment.php $current_user->ID == $comment->user_id `
|
Hi @victorwardi - your suggestion does solve @ansar-859 problem but only by bypassing the permissions logic. So it fixes one problem and opens up another problem. With this change, for example, someone who has Edit / Delete permission revoked would still be able to Edit / Delete comments they made in the past. In my client's service, for example, Edit / Delete is reserved for paying customers. If a customer stops paying and is demoted to the free tier they lose that power. With your suggested code change they would retain that power...at least for comments they had made in the past. Not a terrible side-effect in this use-case but not the intended operation. Either "current user can edit/delete comment" or they can't. |
BUG: In DWQA v1.5.7 a user cannot edit their own Questions, Answers and Comments.
To reproduce...set the DWQA subscriber permissions as follows for Questions Answers, and Comments:
Read: Checked
Post: Checked
Edit: Unchecked
Delete: Unchecked
ROOT CAUSE: There are two reasons why this bug occurs:
NOTE:
The permissions design in DWQA v1.5.7 is misleading and needs a complete review. The permissions implementation is a mixed metaphor of mine & others which does not operate consistently. In DWQA v1.5.7 it appears that the permissions metaphor is as follows (have not tested exhaustively though so take with a grain of salt):
So, if you check POST for questions but uncheck READ for Questions then the user can create a question which they cannot subsequently read! So READ should always be checked if POST is checked.
SOLUTION: A solution will be proposed in a Pull Request with aback-reference to this issue.
The text was updated successfully, but these errors were encountered: