Permission rethinking

* No detailed permissions due to django constraints on model-based permissions
* instead: logic controlled permission by group membership
* adds translations
This commit is contained in:
mipel 2021-07-02 10:10:03 +02:00
parent 92701eda40
commit ed35aea034
5 changed files with 2 additions and 1 deletions

View File

@ -26,7 +26,6 @@ class BaseContext:
def __init__(self, request: HttpRequest, additional_context: dict = {}): def __init__(self, request: HttpRequest, additional_context: dict = {}):
self.context["language"] = request.LANGUAGE_CODE self.context["language"] = request.LANGUAGE_CODE
self.context["user"] = request.user self.context["user"] = request.user
self.__handle_current_role(request)
# Add additional context, derived from given parameters # Add additional context, derived from given parameters
self.context.update(additional_context) self.context.update(additional_context)

View File

@ -6,6 +6,7 @@ Created on: 16.11.20
""" """
from django.contrib.auth import logout from django.contrib.auth import logout
from django.contrib.auth.decorators import login_required
from django.http import HttpRequest from django.http import HttpRequest
from django.shortcuts import redirect, render from django.shortcuts import redirect, render
@ -27,6 +28,7 @@ def logout_view(request: HttpRequest):
return redirect(SSO_SERVER_BASE) return redirect(SSO_SERVER_BASE)
@login_required
def home_view(request: HttpRequest): def home_view(request: HttpRequest):
""" """
Renders the landing page Renders the landing page