fix(morelevel): level mandatory in proil
Cadoles/nineskeletor/pipeline/pr-master There was a failure building this commit Details
Cadoles/nineskeletor/pipeline/head There was a failure building this commit Details

This commit is contained in:
Arnaud Fornerot 2022-09-27 16:48:57 +02:00
parent ea31b7255d
commit b9bb605ad2
2 changed files with 9 additions and 0 deletions

1
.php-version Normal file
View File

@ -0,0 +1 @@
8.1

View File

@ -374,11 +374,19 @@
function requireniveau() { function requireniveau() {
roles=[]; roles=[];
{% if access=="admin" or access=="modo" %}
if($("#user_roles_0").is(":checked")) roles.push("ROLE_ADMIN"); if($("#user_roles_0").is(":checked")) roles.push("ROLE_ADMIN");
if($("#user_roles_1").is(":checked")) roles.push("ROLE_MODO"); if($("#user_roles_1").is(":checked")) roles.push("ROLE_MODO");
if($("#user_roles_2").is(":checked")) roles.push("ROLE_MASTER"); if($("#user_roles_2").is(":checked")) roles.push("ROLE_MASTER");
if($("#user_roles_3").is(":checked")) roles.push("ROLE_MANAGER"); if($("#user_roles_3").is(":checked")) roles.push("ROLE_MANAGER");
if($("#user_roles_4").is(":checked")) roles.push("ROLE_USER"); if($("#user_roles_4").is(":checked")) roles.push("ROLE_USER");
{% else %}
{% if is_granted('ROLE_ADMIN') %} roles.push("ROLE_ADMIN"); {% endif %}
{% if is_granted('ROLE_MODO') %} roles.push("ROLE_MODO"); {% endif %}
{% if is_granted('ROLE_MASTER') %} roles.push("ROLE_MASTER"); {% endif %}
{% if is_granted('ROLE_MANAGER') %} roles.push("ROLE_MANAGER"); {% endif %}
{% if is_granted('ROLE_USER') %} roles.push("ROLE_USER"); {% endif %}
{% endif %}
{% if "ALL" in appNiveau02mandatory %} {% if "ALL" in appNiveau02mandatory %}
$("#user_niveau02").attr("required","required"); $("#user_niveau02").attr("required","required");