feat: limit access for role manager to assignment details
This commit is contained in:
@@ -46,14 +46,19 @@ class DispositionVoter extends Voter
|
||||
$disposition = $subject;
|
||||
|
||||
return match ($attribute) {
|
||||
static::VIEW, static::EDIT, static::CONTRACT, static::INVOICE => $this->assertAdministrativeAccess($token) || $this->assertTeamerAccess($token, $disposition),
|
||||
static::DELETE => $this->assertAdministrativeAccess($token),
|
||||
static::VIEW, static::EDIT, static::CONTRACT, static::INVOICE => $this->assertAdministrativeAccess() || $this->assertTeamerAccess($token, $disposition),
|
||||
static::DELETE => $this->assertAdminAccess(),
|
||||
static::FEEDBACK => $this->assertHouseManagerAccess($token, $disposition),
|
||||
default => false,
|
||||
};
|
||||
}
|
||||
|
||||
private function assertAdministrativeAccess(TokenInterface $token): bool
|
||||
private function assertAdminAccess(): bool
|
||||
{
|
||||
return $this->security->isGranted('ROLE_ADMIN');
|
||||
}
|
||||
|
||||
private function assertAdministrativeAccess(): bool
|
||||
{
|
||||
return $this->security->isGranted('ROLE_ADMINISTRATIVE');
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<div class="pb-8">
|
||||
{% include '_partials/_assignment_info_compact.html.twig' %}
|
||||
</div>
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<div class="col-span-2">
|
||||
<h2 class="font-bold text-lg pb-4">
|
||||
Bewerbungen
|
||||
@@ -103,6 +104,7 @@
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
<h2 class="font-bold text-lg pb-4">
|
||||
Einteilungen
|
||||
</h2>
|
||||
|
||||
@@ -49,9 +49,11 @@
|
||||
<th>
|
||||
{{ knp_pagination_sortable(pagination, 'Bus', 'assignment.pickup') }}
|
||||
</th>
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<th>
|
||||
Bewerbungen
|
||||
</th>
|
||||
{% endif %}
|
||||
<th>
|
||||
Einteilungen
|
||||
</th>
|
||||
@@ -128,11 +130,13 @@
|
||||
-
|
||||
{% endif %}
|
||||
</td>
|
||||
{% if is_granted('ROLE_ADMIN') %}
|
||||
<td>
|
||||
<a href="{{ path('app_administrative_assignment_detail', { 'uuid': assignment.uuid, 'r': return_url() }) }}" class="flex items-center space-x-2">
|
||||
<span>{{ assignment.validApplications|length }}</span>
|
||||
</a>
|
||||
</td>
|
||||
{% endif %}
|
||||
<td>
|
||||
<span>{{ assignment.dispositions|length }}/{{ assignment.availableDispositions }}</span>
|
||||
<ul>
|
||||
|
||||
Reference in New Issue
Block a user