Skip to content
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

Textlab widget not working for non-staff-members #1865

Closed
Tracked by #1928
timobrembeck opened this issue Nov 15, 2022 · 0 comments · Fixed by #1866
Closed
Tracked by #1928

Textlab widget not working for non-staff-members #1865

timobrembeck opened this issue Nov 15, 2022 · 0 comments · Fixed by #1866
Assignees
Labels
🍼 good first issue Good for newcomers 🐛 bug Something isn't working ☺️ effort: low Should be doable in <4h 🆘 prio: urgent Needs to be resolved now(?)
Milestone

Comments

@timobrembeck
Copy link
Member

Describe the Bug

The textlab widget does not work for users who are no staff members.

Steps to Reproduce

  1. Login as admin
  2. Enable Textlab in a region
  3. Login as non-staff in that region
  4. Visit page form
Expected Behavior Actual Behavior
Screenshot 2022-11-15 at 15-31-43 Integreat Redaktionssystem Screenshot 2022-11-15 at 15-31-55 Integreat Redaktionssystem

Additional Information

Traceback
Nov 15 14:09:42 WARNING django.request - 403 Forbidden (Permission denied): /ajax/get_hix_score/
Traceback (most recent call last):
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
  response = get_response(request)
File "/opt/integreat-cms/.venv/lib/python3.9/site-packages/integreat_cms/core/middleware/access_control_middleware.py", line 67, in __call__
  raise PermissionDenied(
django.core.exceptions.PermissionDenied: <SimpleLazyObject: <User (id: XXX, username: XXX, role: Manager)>> does not have the permission to access the staff area

The source of the problem is the same as in #1777.
In addition of fixing the bug, we should also improve the error handling to show an error message and hide the graph if something goes wrong.

@timobrembeck timobrembeck added 🐛 bug Something isn't working 🍼 good first issue Good for newcomers ☺️ effort: low Should be doable in <4h 🆘 prio: urgent Needs to be resolved now(?) labels Nov 15, 2022
@timobrembeck timobrembeck added this to the 22Q4 milestone Nov 15, 2022
@timobrembeck timobrembeck self-assigned this Nov 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🍼 good first issue Good for newcomers 🐛 bug Something isn't working ☺️ effort: low Should be doable in <4h 🆘 prio: urgent Needs to be resolved now(?)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant