Merge branch 'develop' into trunk

This commit is contained in:
Jérémy Munsch 2021-06-29 10:18:16 +02:00
commit a3ebd56bfc

View file

@ -37,9 +37,12 @@ class StoreTicket extends FormRequest
'exists:projects,id',
// @phpcs:ignore Generic.CodeAnalysis.UnusedFunctionParameter.FoundInExtendedClassBeforeLastUsed
function ($attribute, $value, $fail) {
if (auth()->user()->role->equals(Role::admin())) {
return;
}
if (!in_array($value, auth()->user()->projects()->pluck('id')->all())) {
$fail(__('Veuillez choisir entre :values', [
'value' => auth()->user()->projects()->pluck('name')->implode(',')
'values' => auth()->user()->projects()->pluck('name')->implode(',')
]));
}
}