fix(backend): Allow unassigning deleted users, but not assigning
This commit is contained in:
parent
32bcf7ecbf
commit
11a4f87005
|
@ -420,8 +420,10 @@ def assign_job(job_id, current_session: Session):
|
|||
data = request.get_json()
|
||||
job = event_controller.get_job(job_id)
|
||||
try:
|
||||
user = userController.get_user(data["userid"])
|
||||
value = data["value"]
|
||||
user = userController.get_user(
|
||||
data["userid"], deleted=value < 0
|
||||
) # allow unassigning deleted users, but not assigning
|
||||
if (user == current_session.user_ and not user.has_permission(permissions.ASSIGN)) or (
|
||||
user != current_session.user_ and not current_session.user_.has_permission(permissions.ASSIGN_OTHER)
|
||||
):
|
||||
|
|
Loading…
Reference in New Issue