Oprava kontroly pristupu k detailu a editaci osoby
This commit is contained in:
parent
ea43bfaf5c
commit
e0a735391b
|
@ -336,7 +336,7 @@ def person_detail(request, id):
|
||||||
sp_sso_admin = 'sso_admin' in sp
|
sp_sso_admin = 'sso_admin' in sp
|
||||||
|
|
||||||
# Check permissions to edit this object
|
# 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. ')
|
messages.error(request, 'K tomuto záznamu nemáte přístup. ')
|
||||||
return redirect('nalodeni:people_list')
|
return redirect('nalodeni:people_list')
|
||||||
|
|
||||||
|
@ -358,7 +358,7 @@ def person_edit(request, id):
|
||||||
sp_sso_admin = 'sso_admin' in sp
|
sp_sso_admin = 'sso_admin' in sp
|
||||||
|
|
||||||
# Check permissions to edit this object
|
# 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. ')
|
messages.error(request, 'K tomuto záznamu nemáte přístup. ')
|
||||||
return redirect('nalodeni:people_list')
|
return redirect('nalodeni:people_list')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue