-
Notifications
You must be signed in to change notification settings - Fork 81
Description
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:
- Not all dwqa_current_user_can() function invokers pass the postid which is needed by the permission logic to determine if this is the user's own question/answer/comment;
- The comment permissions check requires a commentid not a postid and the commentid is not passed in by the function invoker in appropriate place(s).
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):
- READ: If unchecked the user cannot read any. If checked the user can read all (own & others).
- POST: if unchecked then the user cannot create. If checked the user can create own & others.
- EDIT: if unchecked the user can edit their own. if checked the user can edit all (own & others).
- DELETE: if unchecked the user can delete their own. if checked the user can delete all (own & others).
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.