put mesh_control into user data

This commit is contained in:
Laura Klünder 2024-03-30 18:16:29 +01:00
parent 1e1df10bfa
commit a84a19ec0d
2 changed files with 5 additions and 0 deletions

View file

@ -31,6 +31,10 @@ class UserDataSchema(BaseSchema):
title="control panel access",
description="whether the user signed in can access the control panel.",
)
mesh_control: bool = APIField(
title="mesh control permission",
description="whether the user signed in can manage the mesh.",
)
has_positions: bool = APIField(
title="user has positions",
description="whether the user signed in has created any positions",

View file

@ -13,6 +13,7 @@ def get_user_data(request):
'logged_in': bool(request.user.is_authenticated),
'allow_editor': can_access_editor(request),
'allow_control_panel': request.user_permissions.control_panel,
'mesh_control': request.user_permissions.mesh_control,
'has_positions': Position.user_has_positions(request.user)
}
if permissions: