FIX [parcours][rights] user with only simple view rights cannot create new parcours.

This commit is contained in:
Julie Lenaerts 2023-02-13 17:51:02 +01:00
parent 51681edda7
commit 9465f26f09
2 changed files with 4 additions and 0 deletions

View File

@ -248,6 +248,8 @@ class AccompanyingCourseController extends Controller
*/ */
public function newAction(Request $request): Response public function newAction(Request $request): Response
{ {
$this->denyAccessUnlessGranted(AccompanyingPeriodVoter::CREATE);
$period = new AccompanyingPeriod(); $period = new AccompanyingPeriod();
$em = $this->getDoctrine()->getManager(); $em = $this->getDoctrine()->getManager();

View File

@ -17,12 +17,14 @@
class="btn btn-cancel">{{ 'Person details'|trans }} class="btn btn-cancel">{{ 'Person details'|trans }}
</a> </a>
</li> </li>
{% if is_granted('CHILL_PERSON_ACCOMPANYING_PERIOD_CREATE') %}
<li> <li>
<a class="btn btn-create" <a class="btn btn-create"
href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" role="button"> href="{{ path ('chill_person_accompanying_course_new', {'person_id' : [ person.id ] } ) }}" role="button">
{{ 'Create an accompanying period'|trans }} {{ 'Create an accompanying period'|trans }}
</a> </a>
</li> </li>
{% endif %}
{# Disabled dropdown {# Disabled dropdown
<li class="dropdown"> <li class="dropdown">