Skip to content

[$30] Normal users can edit/delete the comments added by others #217

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

Closed
sdgun opened this issue Nov 20, 2020 · 9 comments
Closed

[$30] Normal users can edit/delete the comments added by others #217

sdgun opened this issue Nov 20, 2020 · 9 comments

Comments

@sdgun
Copy link
Collaborator

sdgun commented Nov 20, 2020

Steps
Log in to forums as a normal user (sdguntcqa)
Go to any available challenge forum discussion added by another user (https://vanilla.topcoder-dev.com/discussion/1751/baze-my-discussion#latest)
Click on ellipsis of a comment from another user

This user can perform edit/delete on it

image

@jmgasper
Copy link
Collaborator

@sdgun - I can't reproduce this. Can you try again please?

@sdgun
Copy link
Collaborator Author

sdgun commented Nov 30, 2020

@jmgasper This can be reproduced, checked by adding a comment from TCConnCopilot in https://vanilla.topcoder-dev.com/discussion/1777/3rd and then log in as user sdguntcqa(pw-T0pc0der@123)

Delete comments issue.zip

@jmgasper jmgasper changed the title Normal users can edit/delete the comments added by others [$30] Normal users can edit/delete the comments added by others Nov 30, 2020
@jmgasper
Copy link
Collaborator

Contest https://www.topcoder.com/challenges/30154852 has been created for this ticket.

This is an automated message for ghostar via Topcoder X

@jmgasper
Copy link
Collaborator

@atelomycterus - I checked this in the permissions. sdguntcqa has roles Vanilla Member and Topcoder User, but neither seem to have rights to edit comments / discussions - only add / view.

@jmgasper
Copy link
Collaborator

Contest https://www.topcoder.com/challenges/30154852 has been updated - it has been assigned to obog.

This is an automated message for ghostar via Topcoder X

@atelomycterus
Copy link
Collaborator

@jmgasper yes, you are right. User doesn't have permisisons. I've checked what permisisons loaded:
image

I've found a bug in Vanilla CommentModel canEdit().

@atelomycterus
Copy link
Collaborator

@jmgasper Fixed. please apply PRs:
#249
topcoder-platform/forums-plugins#51
topcoder-platform/forums-groups-plugin#35
Thanks!

Testing

Don't use TonyJ account for testing because this account has several admin roles with Comments.Edit/Comments.Delete permissions. Please test with group members (copilot, member and so on)

Vanilla user/Topcoder User:
image

How Vanilla works by default

The Edit option is displayed if

  • User has 'Vanilla.Comments.Edit' permission
  • Discussion is closed, but Moderators (role type= moderator) can edit comments
  • User(Non-Moderator/Non-Admin) can edit if User is the author.
    image

The Delete option is displayed if

  • User has 'Vanilla.Comments.Delete' permission
  • User (Non-Moderator/Non-Admin) is the Author + Vanilla.Comments.AllowSelfDelete=true
    'Vanilla.Comments.AllowSelfDelete' is false by default. So 'Delete' shouldn't be displayed for Vanilla User/Topcoder User.

@jmgasper
Copy link
Collaborator

jmgasper commented Dec 1, 2020

Payment task has been updated: https://software.topcoder.com/review/actions/ViewProjectDetails?pid=30154852

This is an automated message for ghostar via Topcoder X

@sdgun
Copy link
Collaborator Author

sdgun commented Dec 2, 2020

Verified from normal user, copilot, con admin and manager.
normal user(sdguntcqa)/manager(TCConManager) - can reply anyone's comments and edit his comments
copilot(TCConnCopilot) - can reply/delete anyone's comments and edit/reply/delete his comments
con admin(TCConAdmin) - can edit/reply/delete anyone's comments and his comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants