Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion app/Http/Controllers/OvertimeTimesheetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class OvertimeTimesheetController extends Controller
{
public function __invoke(?string $month = null): BinaryFileResponse
{
$this->authorize("manageRequestsAsAdministrativeApprover");
$this->authorize("downloadOvertimeSummary");

$month = Carbon::canBeCreatedFromFormat($month, "m-Y")
? Carbon::createFromFormat("d-m-Y", "01-$month")
Expand Down
2 changes: 1 addition & 1 deletion app/Http/Controllers/TimesheetController.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ class TimesheetController extends Controller
{
public function __invoke(VacationTypeConfigRetriever $configRetriever, ?string $month = null): BinaryFileResponse
{
$this->authorize("manageRequestsAsAdministrativeApprover");
$this->authorize("downloadWorkHoursSummary");

$month = Carbon::canBeCreatedFromFormat($month, "m-Y")
? Carbon::createFromFormat("d-m-Y", "01-$month")
Expand Down
23 changes: 12 additions & 11 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions config/permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,8 @@
"receiveBenefitsReportCreationNotification",
"manageEquipment",
"receiveOvertimeRequestsSummaryNotification",
"downloadWorkHoursSummary",
"downloadOvertimeSummary",
],
"permission_roles" => [
Role::Administrator->value => [
Expand All @@ -90,6 +92,8 @@
"receiveVacationRequestStatusChangedNotification",
"manageEquipment",
"receiveOvertimeRequestsSummaryNotification",
"downloadWorkHoursSummary",
"downloadOvertimeSummary",
],
Role::AdministrativeApprover->value => [
"managePermissions",
Expand All @@ -114,6 +118,8 @@
"receiveVacationRequestStatusChangedNotification",
"receiveBenefitsReportCreationNotification",
"manageEquipment",
"downloadWorkHoursSummary",
"downloadOvertimeSummary",
],
Role::TechnicalApprover->value => [
"manageTechnologies",
Expand Down
10 changes: 10 additions & 0 deletions resources/js/Composables/permissionInfo.js
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ const permissionsInfo = [
'value': 'skipRequestFlow',
'section': 'Urlopy',
},
{
'name': 'Pobieranie podsumowania godzin pracy',
'value': 'downloadWorkHoursSummary',
'section': 'Urlopy',
},
{
'name': 'Zarządzanie wnioskami jako przełożony administracyjny',
'value': 'manageOvertimeAsAdministrativeApprover',
Expand All @@ -99,6 +104,11 @@ const permissionsInfo = [
'value': 'listAllOvertimeRequests',
'section': 'Nadgodziny',
},
{
'name': 'Pobieranie podsumowania nadgodzin',
'value': 'downloadOvertimeSummary',
'section': 'Nadgodziny',
},
{
'name': 'Nadchodzące i zaległe badania medycyny pracy',
'value': 'receiveUpcomingAndOverdueMedicalExamsNotification',
Expand Down
6 changes: 3 additions & 3 deletions resources/js/Pages/Calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -144,14 +144,14 @@ function resetSettings() {
</span>
</button>
<a
v-if="auth.can.manageRequestsAsAdministrativeApprover"
v-if="auth.can.downloadWorkHoursSummary"
:href="`/vacation/timesheet/${selectedMonth.toFormat('LL-yyyy')}`"
class="block py-3 px-4 text-sm font-medium leading-4 text-center text-white bg-blumilk-600 hover:bg-blumilk-700 rounded-md border border-transparent focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
>
Pobierz plik Excel
Pobierz podsumowanie godzin
</a>
<a
v-if="auth.can.manageOvertimeAsAdministrativeApprover"
v-if="auth.can.downloadOvertimeSummary"
:href="`/overtime/timesheet/${selectedMonth.toFormat('LL-yyyy')}`"
class="block py-3 px-4 text-sm font-medium leading-4 text-center text-white bg-blumilk-600 hover:bg-blumilk-700 rounded-md border border-transparent focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
>
Expand Down
4 changes: 2 additions & 2 deletions resources/js/Pages/OvertimeRequest/ApproversIndex.vue
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ watch(form, debounce(() => {
</h2>
</div>
<div
v-if="auth.can.manageRequestsAsAdministrativeApprover"
v-if="auth.can.downloadOvertimeSummary"
class="flex"
>
<a
:href="`/overtime/timesheet/${filters.month}`"
class="block py-3 px-4 ml-3 text-sm font-medium leading-4 text-center text-white bg-blumilk-600 hover:bg-blumilk-700 rounded-md border border-transparent focus:outline-none focus:ring-2 focus:ring-blumilk-500 focus:ring-offset-2 shadow-sm"
>
Pobierz plik Excel
Pobierz nadgodziny
</a>
</div>
</div>
Expand Down
12 changes: 9 additions & 3 deletions tests/Feature/PermissionTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@ public function testAdminCanSeeEditEmployeePermissionsForm(): void
->where("receiveVacationRequestWaitsForApprovalNotification", false)
->where("receiveVacationRequestStatusChangedNotification", false)
->where("manageEquipment", false)
->where("receiveOvertimeRequestsSummaryNotification", false),
->where("receiveOvertimeRequestsSummaryNotification", false)
->where("downloadWorkHoursSummary", false)
->where("downloadOvertimeSummary", false),
),
);
}
Expand Down Expand Up @@ -96,7 +98,9 @@ public function testAdminCanSeeEditTechnicalApproverPermissionsForm(): void
->where("receiveVacationRequestWaitsForApprovalNotification", true)
->where("receiveVacationRequestStatusChangedNotification", true)
->where("manageEquipment", false)
->where("receiveOvertimeRequestsSummaryNotification", true),
->where("receiveOvertimeRequestsSummaryNotification", true)
->where("downloadWorkHoursSummary", false)
->where("downloadOvertimeSummary", false),
),
);
}
Expand Down Expand Up @@ -140,7 +144,9 @@ public function testAdminCanSeeEditAdministrativeApproverPermissionsForm(): void
->where("receiveVacationRequestWaitsForApprovalNotification", true)
->where("receiveVacationRequestStatusChangedNotification", true)
->where("manageEquipment", true)
->where("receiveOvertimeRequestsSummaryNotification", false),
->where("receiveOvertimeRequestsSummaryNotification", false)
->where("downloadWorkHoursSummary", true)
->where("downloadOvertimeSummary", true),
),
);
}
Expand Down