put mesh_control into user data
This commit is contained in:
parent
1e1df10bfa
commit
a84a19ec0d
2 changed files with 5 additions and 0 deletions
|
@ -31,6 +31,10 @@ class UserDataSchema(BaseSchema):
|
||||||
title="control panel access",
|
title="control panel access",
|
||||||
description="whether the user signed in can access the control panel.",
|
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(
|
has_positions: bool = APIField(
|
||||||
title="user has positions",
|
title="user has positions",
|
||||||
description="whether the user signed in has created any positions",
|
description="whether the user signed in has created any positions",
|
||||||
|
|
|
@ -13,6 +13,7 @@ def get_user_data(request):
|
||||||
'logged_in': bool(request.user.is_authenticated),
|
'logged_in': bool(request.user.is_authenticated),
|
||||||
'allow_editor': can_access_editor(request),
|
'allow_editor': can_access_editor(request),
|
||||||
'allow_control_panel': request.user_permissions.control_panel,
|
'allow_control_panel': request.user_permissions.control_panel,
|
||||||
|
'mesh_control': request.user_permissions.mesh_control,
|
||||||
'has_positions': Position.user_has_positions(request.user)
|
'has_positions': Position.user_has_positions(request.user)
|
||||||
}
|
}
|
||||||
if permissions:
|
if permissions:
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue