[TELE-1620]add authentication_delivrance_items_visibility
This commit is contained in:
parent
30605e75fb
commit
20b0bee51c
|
@ -1,4 +1,5 @@
|
|||
import datetime
|
||||
import json
|
||||
import re
|
||||
from decimal import Decimal
|
||||
|
||||
|
@ -58,6 +59,21 @@ def is_strong_authentication(session_user):
|
|||
return bool("_niss" in session_user.verified_fields)
|
||||
|
||||
|
||||
def authentication_delivrance_items_visibility(data_source, session_user):
|
||||
"""
|
||||
Anciennement commune.py authentication_delivrance_items_visibility
|
||||
data_source : data source mode_de_delivrance json
|
||||
session_user : session_user
|
||||
"""
|
||||
if is_strong_authentication(session_user):
|
||||
data_source = json.loads(data_source)
|
||||
for elm in data_source:
|
||||
if "commune" not in elm["id"]:
|
||||
elm["disabled"] = False
|
||||
return json.dumps(data_source)
|
||||
return data_source
|
||||
|
||||
|
||||
@register.filter
|
||||
def is_agent(session_user):
|
||||
"""
|
||||
|
|
Loading…
Reference in New Issue