fossunited/mon_school

Permissions issue when commenting on sketches (due to update_metrics hook)

Closed this issue · 0 comments

Describe the bug
When a non-admin writes a comment on a sketch, the update_metrics method in its hooks tries to update Simple Metrics documents to update the number of comments, but it fails because non-admins don't have perms to write to Simple Metrics doctype.
As a result, a non-admin cannot comment on sketches.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the details page of a sketch as a non-admin user
  2. Write a comment and hit submit
  3. It will throw a "Not Permitted" error

Expected behavior
Permissions on simple metrics should be ignored when one writes a comment on sketch

Screenshots
image

Desktop (please complete the following information):

  • OS: [e.g. iOS]: macOS Big Sur
  • Browser [e.g. chrome, safari]: chrome
  • Version [e.g. 22]: 96

Additional context
This is relevant to #86 also.