From e0a735391b55b34277b928de53b211d9725adbf4 Mon Sep 17 00:00:00 2001 From: Martin Rejman Date: Mon, 15 Apr 2019 02:38:47 +0200 Subject: [PATCH] Oprava kontroly pristupu k detailu a editaci osoby --- src/nalodeni/people.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/nalodeni/people.py b/src/nalodeni/people.py index 7e2b664..eb918b0 100644 --- a/src/nalodeni/people.py +++ b/src/nalodeni/people.py @@ -336,7 +336,7 @@ def person_detail(request, id): sp_sso_admin = 'sso_admin' in sp # Check permissions to edit this object - if not sp_sso_admin and not obj.district in get_AppUser_districts(request): + if not sp_sso_admin and not obj.district in request.session['spc']['dist']: messages.error(request, 'K tomuto záznamu nemáte přístup. ') return redirect('nalodeni:people_list') @@ -358,7 +358,7 @@ def person_edit(request, id): sp_sso_admin = 'sso_admin' in sp # Check permissions to edit this object - if not sp_sso_admin and not obj.district in get_AppUser_districts(request): + if not sp_sso_admin and not obj.district in request.session['spc']['dist']: messages.error(request, 'K tomuto záznamu nemáte přístup. ') return redirect('nalodeni:people_list')