Skip to content

Commit

Permalink
fix: cms_dispatch permissions
Browse files Browse the repository at this point in the history
  • Loading branch information
francesco-filicetti committed Mar 8, 2024
1 parent 4714724 commit ed0dc2e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/cms/contexts/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
AUTH_USER_GROUPS = (
('0', _('Public')),
('1', _('Inherit')),
('2', _('Registered users')),
# ('user_attribute_1', 'level_1'),
# ('user_attribute_2', 'level_2',),
)
2 changes: 1 addition & 1 deletion src/cms/contexts/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def cms_dispatch(request):
return render(request, page.base_template.template_file, context)
elif not request.user.is_authenticated:
return redirect(f"{settings.LOGIN_URL}?next=//{website.domain}{webpath.get_full_path()}")
elif request.user.is_superuser:
elif access_level == '2' or request.user.is_superuser:
return render(request, page.base_template.template_file, context)
elif getattr(request.user, access_level, None):
return render(request, page.base_template.template_file, context)
Expand Down

0 comments on commit ed0dc2e

Please sign in to comment.