Default group required
* adds access checks depending on the current group confgiguration of a user * removes buttons for adding/editing or removing data if default group is not set for a user * removes buttons for adding/removing related data in unshared interventions * removes shared-user setting from share menu of an intervention if user is not zb or ets * renames has_access() from intervention Model into is_shared_with() for more clarity * fixes bug in group check in_group() from utils.py
This commit is contained in:
@@ -5,6 +5,7 @@ Contact: michel.peltriaux@sgdnord.rlp.de
|
||||
Created on: 02.07.21
|
||||
|
||||
"""
|
||||
from django.utils.translation import gettext_lazy as _
|
||||
from django.contrib.auth.models import User
|
||||
|
||||
|
||||
@@ -18,4 +19,6 @@ def in_group(user: User, group: str) -> bool:
|
||||
Returns:
|
||||
bool
|
||||
"""
|
||||
return group in user.groups.values("name")
|
||||
return user.groups.filter(
|
||||
name=_(group)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user