#63 - permissions
This commit is contained in:
parent
c9a7ec4869
commit
b81b0f857c
@ -5,17 +5,31 @@ declare(strict_types=1);
|
|||||||
namespace Toby\Architecture\Providers;
|
namespace Toby\Architecture\Providers;
|
||||||
|
|
||||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||||
use Toby\Domain\Policies\HolidayPolicy;
|
use Illuminate\Support\Facades\Gate;
|
||||||
use Toby\Eloquent\Models\Holiday;
|
use Toby\Domain\Enums\Role;
|
||||||
|
use Toby\Domain\Policies\VacationRequestPolicy;
|
||||||
|
use Toby\Eloquent\Models\User;
|
||||||
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
|
|
||||||
class AuthServiceProvider extends ServiceProvider
|
class AuthServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
protected $policies = [
|
protected $policies = [
|
||||||
Holiday::class => HolidayPolicy::class
|
VacationRequest::class => VacationRequestPolicy::class,
|
||||||
];
|
];
|
||||||
|
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
$this->registerPolicies();
|
$this->registerPolicies();
|
||||||
|
|
||||||
|
Gate::before(function (User $user) {
|
||||||
|
if ($user->role === Role::Administrator) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
Gate::define("manageUsers", fn(User $user) => $user->role === Role::AdministrativeApprover);
|
||||||
|
Gate::define("manageHolidays", fn(User $user) => $user->role === Role::AdministrativeApprover);
|
||||||
|
Gate::define("manageVacationLimits", fn(User $user) => $user->role === Role::AdministrativeApprover);
|
||||||
|
Gate::define("generateTimesheet", fn(User $user) => $user->role === Role::AdministrativeApprover);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
declare(strict_types=1);
|
|
||||||
|
|
||||||
namespace Toby\Domain\Policies;
|
|
||||||
|
|
||||||
use Toby\Domain\Enums\Role;
|
|
||||||
use Toby\Eloquent\Models\User;
|
|
||||||
|
|
||||||
class HolidayPolicy
|
|
||||||
{
|
|
||||||
public function create(User $user): bool
|
|
||||||
{
|
|
||||||
return $user->role == Role::AdministrativeApprover || $user->role == Role::Administrator;
|
|
||||||
}
|
|
||||||
}
|
|
51
app/Domain/Policies/VacationRequestPolicy.php
Normal file
51
app/Domain/Policies/VacationRequestPolicy.php
Normal file
@ -0,0 +1,51 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace Toby\Domain\Policies;
|
||||||
|
|
||||||
|
use Toby\Domain\Enums\Role;
|
||||||
|
use Toby\Eloquent\Models\User;
|
||||||
|
use Toby\Eloquent\Models\VacationRequest;
|
||||||
|
|
||||||
|
class VacationRequestPolicy
|
||||||
|
{
|
||||||
|
public function createOnBehalfOfEmployee(User $user): bool
|
||||||
|
{
|
||||||
|
return $user->role === Role::AdministrativeApprover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function acceptAsAdminApprover(User $user): bool
|
||||||
|
{
|
||||||
|
return $user->role === Role::AdministrativeApprover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function acceptAsTechApprover(User $user): bool
|
||||||
|
{
|
||||||
|
return $user->role === Role::TechnicalApprover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function skipFlow(User $user): bool
|
||||||
|
{
|
||||||
|
return $user->role === Role::AdministrativeApprover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function reject(User $user): bool
|
||||||
|
{
|
||||||
|
return in_array($user->role, [Role::AdministrativeApprover, Role::TechnicalApprover], true);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function cancel(User $user): bool
|
||||||
|
{
|
||||||
|
return $user->role === Role::AdministrativeApprover;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show(User $user, VacationRequest $vacationRequest): bool
|
||||||
|
{
|
||||||
|
if ($vacationRequest->user->is($user)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return in_array($user->role, [Role::TechnicalApprover, Role::AdministrativeApprover], true);
|
||||||
|
}
|
||||||
|
}
|
@ -4,10 +4,10 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Toby\Infrastructure\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
use Toby\Domain\Policies\HolidayPolicy;
|
|
||||||
use Toby\Eloquent\Models\Holiday;
|
use Toby\Eloquent\Models\Holiday;
|
||||||
use Toby\Infrastructure\Http\Requests\HolidayRequest;
|
use Toby\Infrastructure\Http\Requests\HolidayRequest;
|
||||||
use Toby\Infrastructure\Http\Resources\HolidayFormDataResource;
|
use Toby\Infrastructure\Http\Resources\HolidayFormDataResource;
|
||||||
@ -21,22 +21,31 @@ class HolidayController extends Controller
|
|||||||
->orderBy("date")
|
->orderBy("date")
|
||||||
->get();
|
->get();
|
||||||
|
|
||||||
$user = $request->user();
|
|
||||||
return inertia("Holidays/Index", [
|
return inertia("Holidays/Index", [
|
||||||
"holidays" => HolidayResource::collection($holidays),
|
"holidays" => HolidayResource::collection($holidays),
|
||||||
"can" => [
|
"can" => [
|
||||||
"create" => $user->can("create", Holiday::class)
|
"manageHolidays" => $request->user()->can("manageHolidays"),
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function create(): Response
|
public function create(): Response
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageHolidays");
|
||||||
|
|
||||||
return inertia("Holidays/Create");
|
return inertia("Holidays/Create");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function store(HolidayRequest $request): RedirectResponse
|
public function store(HolidayRequest $request): RedirectResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageHolidays");
|
||||||
|
|
||||||
Holiday::query()->create($request->data());
|
Holiday::query()->create($request->data());
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
@ -44,15 +53,25 @@ class HolidayController extends Controller
|
|||||||
->with("success", __("Holiday has been created."));
|
->with("success", __("Holiday has been created."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function edit(Holiday $holiday): Response
|
public function edit(Holiday $holiday): Response
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageHolidays");
|
||||||
|
|
||||||
return inertia("Holidays/Edit", [
|
return inertia("Holidays/Edit", [
|
||||||
"holiday" => new HolidayFormDataResource($holiday),
|
"holiday" => new HolidayFormDataResource($holiday),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function update(HolidayRequest $request, Holiday $holiday): RedirectResponse
|
public function update(HolidayRequest $request, Holiday $holiday): RedirectResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageHolidays");
|
||||||
|
|
||||||
$holiday->update($request->data());
|
$holiday->update($request->data());
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
@ -60,8 +79,13 @@ class HolidayController extends Controller
|
|||||||
->with("success", __("Holiday has been updated."));
|
->with("success", __("Holiday has been updated."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function destroy(Holiday $holiday): RedirectResponse
|
public function destroy(Holiday $holiday): RedirectResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageHolidays");
|
||||||
|
|
||||||
$holiday->delete();
|
$holiday->delete();
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
|
@ -16,6 +16,8 @@ class TimesheetController extends Controller
|
|||||||
{
|
{
|
||||||
public function __invoke(Month $month, YearPeriodRetriever $yearPeriodRetriever): BinaryFileResponse
|
public function __invoke(Month $month, YearPeriodRetriever $yearPeriodRetriever): BinaryFileResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("generateTimesheet");
|
||||||
|
|
||||||
$yearPeriod = $yearPeriodRetriever->selected();
|
$yearPeriod = $yearPeriodRetriever->selected();
|
||||||
$carbonMonth = Carbon::create($yearPeriod->year, $month->toCarbonNumber());
|
$carbonMonth = Carbon::create($yearPeriod->year, $month->toCarbonNumber());
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Toby\Infrastructure\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
@ -16,8 +17,13 @@ use Toby\Infrastructure\Http\Resources\UserResource;
|
|||||||
|
|
||||||
class UserController extends Controller
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function index(Request $request): Response
|
public function index(Request $request): Response
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageUsers");
|
||||||
|
|
||||||
$users = User::query()
|
$users = User::query()
|
||||||
->withTrashed()
|
->withTrashed()
|
||||||
->search($request->query("search"))
|
->search($request->query("search"))
|
||||||
@ -32,16 +38,26 @@ class UserController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function create(): Response
|
public function create(): Response
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageUsers");
|
||||||
|
|
||||||
return inertia("Users/Create", [
|
return inertia("Users/Create", [
|
||||||
"employmentForms" => EmploymentForm::casesToSelect(),
|
"employmentForms" => EmploymentForm::casesToSelect(),
|
||||||
"roles" => Role::casesToSelect(),
|
"roles" => Role::casesToSelect(),
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function store(UserRequest $request): RedirectResponse
|
public function store(UserRequest $request): RedirectResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageUsers");
|
||||||
|
|
||||||
User::query()->create($request->data());
|
User::query()->create($request->data());
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
@ -49,8 +65,13 @@ class UserController extends Controller
|
|||||||
->with("success", __("User has been created."));
|
->with("success", __("User has been created."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function edit(User $user): Response
|
public function edit(User $user): Response
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageUsers");
|
||||||
|
|
||||||
return inertia("Users/Edit", [
|
return inertia("Users/Edit", [
|
||||||
"user" => new UserFormDataResource($user),
|
"user" => new UserFormDataResource($user),
|
||||||
"employmentForms" => EmploymentForm::casesToSelect(),
|
"employmentForms" => EmploymentForm::casesToSelect(),
|
||||||
@ -58,8 +79,13 @@ class UserController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function update(UserRequest $request, User $user): RedirectResponse
|
public function update(UserRequest $request, User $user): RedirectResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageUsers");
|
||||||
|
|
||||||
$user->update($request->data());
|
$user->update($request->data());
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
@ -67,8 +93,13 @@ class UserController extends Controller
|
|||||||
->with("success", __("User has been updated."));
|
->with("success", __("User has been updated."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function destroy(User $user): RedirectResponse
|
public function destroy(User $user): RedirectResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageUsers");
|
||||||
|
|
||||||
$user->delete();
|
$user->delete();
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
@ -76,8 +107,13 @@ class UserController extends Controller
|
|||||||
->with("success", __("User has been deleted."));
|
->with("success", __("User has been deleted."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function restore(User $user): RedirectResponse
|
public function restore(User $user): RedirectResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageUsers");
|
||||||
|
|
||||||
$user->restore();
|
$user->restore();
|
||||||
|
|
||||||
return redirect()
|
return redirect()
|
||||||
|
@ -4,6 +4,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Toby\Infrastructure\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
use Toby\Domain\CalendarGenerator;
|
use Toby\Domain\CalendarGenerator;
|
||||||
@ -15,6 +16,7 @@ use Toby\Infrastructure\Http\Resources\UserResource;
|
|||||||
class VacationCalendarController extends Controller
|
class VacationCalendarController extends Controller
|
||||||
{
|
{
|
||||||
public function index(
|
public function index(
|
||||||
|
Request $request,
|
||||||
YearPeriodRetriever $yearPeriodRetriever,
|
YearPeriodRetriever $yearPeriodRetriever,
|
||||||
CalendarGenerator $calendarGenerator,
|
CalendarGenerator $calendarGenerator,
|
||||||
?string $month = null,
|
?string $month = null,
|
||||||
@ -35,6 +37,9 @@ class VacationCalendarController extends Controller
|
|||||||
"calendar" => $calendar,
|
"calendar" => $calendar,
|
||||||
"currentMonth" => $month->value,
|
"currentMonth" => $month->value,
|
||||||
"users" => UserResource::collection($users),
|
"users" => UserResource::collection($users),
|
||||||
|
"can" => [
|
||||||
|
"generateTimesheet" => $request->user()->can("generateTimesheet"),
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,6 +14,8 @@ class VacationLimitController extends Controller
|
|||||||
{
|
{
|
||||||
public function edit(): Response
|
public function edit(): Response
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageVacationLimits");
|
||||||
|
|
||||||
$limits = VacationLimit::query()
|
$limits = VacationLimit::query()
|
||||||
->with("user")
|
->with("user")
|
||||||
->orderByUserField("last_name")
|
->orderByUserField("last_name")
|
||||||
@ -27,6 +29,8 @@ class VacationLimitController extends Controller
|
|||||||
|
|
||||||
public function update(VacationLimitRequest $request): RedirectResponse
|
public function update(VacationLimitRequest $request): RedirectResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("manageVacationLimits");
|
||||||
|
|
||||||
$data = $request->data();
|
$data = $request->data();
|
||||||
|
|
||||||
foreach ($request->vacationLimits() as $limit) {
|
foreach ($request->vacationLimits() as $limit) {
|
||||||
|
@ -5,11 +5,12 @@ declare(strict_types=1);
|
|||||||
namespace Toby\Infrastructure\Http\Controllers;
|
namespace Toby\Infrastructure\Http\Controllers;
|
||||||
|
|
||||||
use Barryvdh\DomPDF\Facade\Pdf;
|
use Barryvdh\DomPDF\Facade\Pdf;
|
||||||
|
use Illuminate\Auth\Access\AuthorizationException;
|
||||||
use Illuminate\Http\RedirectResponse;
|
use Illuminate\Http\RedirectResponse;
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use Illuminate\Http\Response as LaravelResponse;
|
use Illuminate\Http\Response as LaravelResponse;
|
||||||
|
use Illuminate\Validation\ValidationException;
|
||||||
use Inertia\Response;
|
use Inertia\Response;
|
||||||
use Toby\Domain\Enums\Role;
|
|
||||||
use Toby\Domain\Enums\VacationType;
|
use Toby\Domain\Enums\VacationType;
|
||||||
use Toby\Domain\States\VacationRequest\AcceptedByAdministrative;
|
use Toby\Domain\States\VacationRequest\AcceptedByAdministrative;
|
||||||
use Toby\Domain\States\VacationRequest\AcceptedByTechnical;
|
use Toby\Domain\States\VacationRequest\AcceptedByTechnical;
|
||||||
@ -49,8 +50,12 @@ class VacationRequestController extends Controller
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function show(Request $request, VacationRequest $vacationRequest): Response
|
public function show(Request $request, VacationRequest $vacationRequest): Response
|
||||||
{
|
{
|
||||||
|
$this->authorize("show", $vacationRequest);
|
||||||
$user = $request->user();
|
$user = $request->user();
|
||||||
|
|
||||||
return inertia("VacationRequest/Show", [
|
return inertia("VacationRequest/Show", [
|
||||||
@ -58,19 +63,24 @@ class VacationRequestController extends Controller
|
|||||||
"activities" => VacationRequestActivityResource::collection($vacationRequest->activities),
|
"activities" => VacationRequestActivityResource::collection($vacationRequest->activities),
|
||||||
"can" => [
|
"can" => [
|
||||||
"acceptAsTechnical" => $vacationRequest->state->canTransitionTo(AcceptedByTechnical::class)
|
"acceptAsTechnical" => $vacationRequest->state->canTransitionTo(AcceptedByTechnical::class)
|
||||||
&& $user === Role::TechnicalApprover,
|
&& $user->can("acceptAsTechApprover", $vacationRequest),
|
||||||
"acceptAsAdministrative" => $vacationRequest->state->canTransitionTo(AcceptedByAdministrative::class)
|
"acceptAsAdministrative" => $vacationRequest->state->canTransitionTo(AcceptedByAdministrative::class)
|
||||||
&& $user === Role::AdministrativeApprover,
|
&& $user->can("acceptAsAdminApprover", $vacationRequest),
|
||||||
"reject" => $vacationRequest->state->canTransitionTo(Rejected::class)
|
"reject" => $vacationRequest->state->canTransitionTo(Rejected::class)
|
||||||
&& in_array($user->role, [Role::TechnicalApprover, Role::AdministrativeApprover], true),
|
&& $user->can("reject", $vacationRequest),
|
||||||
"cancel" => $vacationRequest->state->canTransitionTo(Cancelled::class)
|
"cancel" => $vacationRequest->state->canTransitionTo(Cancelled::class)
|
||||||
&& $user === Role::AdministrativeApprover,
|
&& $user->can("cancel", $vacationRequest),
|
||||||
],
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function download(VacationRequest $vacationRequest): LaravelResponse
|
public function download(VacationRequest $vacationRequest): LaravelResponse
|
||||||
{
|
{
|
||||||
|
$this->authorize("show", $vacationRequest);
|
||||||
|
|
||||||
$pdf = PDF::loadView("pdf.vacation-request", [
|
$pdf = PDF::loadView("pdf.vacation-request", [
|
||||||
"vacationRequest" => $vacationRequest,
|
"vacationRequest" => $vacationRequest,
|
||||||
]);
|
]);
|
||||||
@ -78,7 +88,7 @@ class VacationRequestController extends Controller
|
|||||||
return $pdf->stream();
|
return $pdf->stream();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function create(): Response
|
public function create(Request $request): Response
|
||||||
{
|
{
|
||||||
$users = User::query()
|
$users = User::query()
|
||||||
->orderBy("last_name")
|
->orderBy("last_name")
|
||||||
@ -88,15 +98,31 @@ class VacationRequestController extends Controller
|
|||||||
return inertia("VacationRequest/Create", [
|
return inertia("VacationRequest/Create", [
|
||||||
"vacationTypes" => VacationType::casesToSelect(),
|
"vacationTypes" => VacationType::casesToSelect(),
|
||||||
"users" => UserResource::collection($users),
|
"users" => UserResource::collection($users),
|
||||||
|
"can" => [
|
||||||
|
"createOnBehalfOfEmployee" => $request->user()->can("createOnBehalfOfEmployee", VacationRequest::class),
|
||||||
|
"skipFlow" => $request->user()->can("skipFlow", VacationRequest::class),
|
||||||
|
],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
* @throws ValidationException
|
||||||
|
*/
|
||||||
public function store(
|
public function store(
|
||||||
VacationRequestRequest $request,
|
VacationRequestRequest $request,
|
||||||
VacationRequestValidator $vacationRequestValidator,
|
VacationRequestValidator $vacationRequestValidator,
|
||||||
VacationRequestStateManager $stateManager,
|
VacationRequestStateManager $stateManager,
|
||||||
VacationDaysCalculator $vacationDaysCalculator,
|
VacationDaysCalculator $vacationDaysCalculator,
|
||||||
): RedirectResponse {
|
): RedirectResponse {
|
||||||
|
if ($request->createsOnBehalfOfEmployee()) {
|
||||||
|
$this->authorize("createOnBehalfOfEmployee", VacationRequest::class);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($request->wantsSkipFlow()) {
|
||||||
|
$this->authorize("skipFlow", VacationRequest::class);
|
||||||
|
}
|
||||||
|
|
||||||
/** @var VacationRequest $vacationRequest */
|
/** @var VacationRequest $vacationRequest */
|
||||||
$vacationRequest = $request->user()->createdVacationRequests()->make($request->data());
|
$vacationRequest = $request->user()->createdVacationRequests()->make($request->data());
|
||||||
$vacationRequestValidator->validate($vacationRequest);
|
$vacationRequestValidator->validate($vacationRequest);
|
||||||
@ -124,44 +150,64 @@ class VacationRequestController extends Controller
|
|||||||
->with("success", __("Vacation request has been created."));
|
->with("success", __("Vacation request has been created."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function reject(
|
public function reject(
|
||||||
Request $request,
|
Request $request,
|
||||||
VacationRequest $vacationRequest,
|
VacationRequest $vacationRequest,
|
||||||
VacationRequestStateManager $stateManager,
|
VacationRequestStateManager $stateManager,
|
||||||
): RedirectResponse {
|
): RedirectResponse {
|
||||||
|
$this->authorize("reject", $vacationRequest);
|
||||||
|
|
||||||
$stateManager->reject($vacationRequest, $request->user());
|
$stateManager->reject($vacationRequest, $request->user());
|
||||||
|
|
||||||
return redirect()->back()
|
return redirect()->back()
|
||||||
->with("success", __("Vacation request has been rejected."));
|
->with("success", __("Vacation request has been rejected."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function cancel(
|
public function cancel(
|
||||||
Request $request,
|
Request $request,
|
||||||
VacationRequest $vacationRequest,
|
VacationRequest $vacationRequest,
|
||||||
VacationRequestStateManager $stateManager,
|
VacationRequestStateManager $stateManager,
|
||||||
): RedirectResponse {
|
): RedirectResponse {
|
||||||
|
$this->authorize("cancel", $vacationRequest);
|
||||||
|
|
||||||
$stateManager->cancel($vacationRequest, $request->user());
|
$stateManager->cancel($vacationRequest, $request->user());
|
||||||
|
|
||||||
return redirect()->back()
|
return redirect()->back()
|
||||||
->with("success", __("Vacation request has been cancelled."));
|
->with("success", __("Vacation request has been cancelled."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function acceptAsTechnical(
|
public function acceptAsTechnical(
|
||||||
Request $request,
|
Request $request,
|
||||||
VacationRequest $vacationRequest,
|
VacationRequest $vacationRequest,
|
||||||
VacationRequestStateManager $stateManager,
|
VacationRequestStateManager $stateManager,
|
||||||
): RedirectResponse {
|
): RedirectResponse {
|
||||||
|
$this->authorize("acceptAsTechApprover", $vacationRequest);
|
||||||
|
|
||||||
$stateManager->acceptAsTechnical($vacationRequest, $request->user());
|
$stateManager->acceptAsTechnical($vacationRequest, $request->user());
|
||||||
|
|
||||||
return redirect()->back()
|
return redirect()->back()
|
||||||
->with("success", __("Vacation request has been accepted."));
|
->with("success", __("Vacation request has been accepted."));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @throws AuthorizationException
|
||||||
|
*/
|
||||||
public function acceptAsAdministrative(
|
public function acceptAsAdministrative(
|
||||||
Request $request,
|
Request $request,
|
||||||
VacationRequest $vacationRequest,
|
VacationRequest $vacationRequest,
|
||||||
VacationRequestStateManager $stateManager,
|
VacationRequestStateManager $stateManager,
|
||||||
): RedirectResponse {
|
): RedirectResponse {
|
||||||
|
$this->authorize("acceptAsAdminApprover", $vacationRequest);
|
||||||
|
|
||||||
$stateManager->acceptAsAdministrative($vacationRequest, $request->user());
|
$stateManager->acceptAsAdministrative($vacationRequest, $request->user());
|
||||||
|
|
||||||
return redirect()->back()
|
return redirect()->back()
|
||||||
|
@ -23,6 +23,10 @@ class HandleInertiaRequests extends Middleware
|
|||||||
return array_merge(parent::share($request), [
|
return array_merge(parent::share($request), [
|
||||||
"auth" => fn() => [
|
"auth" => fn() => [
|
||||||
"user" => $user ? new UserResource($user) : null,
|
"user" => $user ? new UserResource($user) : null,
|
||||||
|
"can" => [
|
||||||
|
"manageVacationLimits" => $user ? $user->can("manageVacationLimits") : false,
|
||||||
|
"manageUsers" => $user ? $user->can("manageUsers") : false,
|
||||||
|
],
|
||||||
],
|
],
|
||||||
"flash" => fn() => [
|
"flash" => fn() => [
|
||||||
"success" => $request->session()->get("success"),
|
"success" => $request->session()->get("success"),
|
||||||
|
@ -27,16 +27,29 @@ class VacationRequestRequest extends FormRequest
|
|||||||
|
|
||||||
public function data(): array
|
public function data(): array
|
||||||
{
|
{
|
||||||
$from = $this->get("from");
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
"user_id" => $this->get("user"),
|
"user_id" => $this->get("user"),
|
||||||
"type" => $this->get("type"),
|
"type" => $this->get("type"),
|
||||||
"from" => $from,
|
"from" => $this->get("from"),
|
||||||
"to" => $this->get("to"),
|
"to" => $this->get("to"),
|
||||||
"year_period_id" => YearPeriod::findByYear(Carbon::create($from)->year)->id,
|
"year_period_id" => $this->yearPeriod()->id,
|
||||||
"comment" => $this->get("comment"),
|
"comment" => $this->get("comment"),
|
||||||
"flow_skipped" => $this->boolean("flowSkipped"),
|
"flow_skipped" => $this->boolean("flowSkipped"),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function yearPeriod(): YearPeriod
|
||||||
|
{
|
||||||
|
return YearPeriod::findByYear(Carbon::create($this->get("from"))->year);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function createsOnBehalfOfEmployee(): bool
|
||||||
|
{
|
||||||
|
return $this->user()->id !== $this->get("user");
|
||||||
|
}
|
||||||
|
|
||||||
|
public function wantsSkipFlow(): bool
|
||||||
|
{
|
||||||
|
return $this->boolean("flowSkipped");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
237
composer.lock
generated
237
composer.lock
generated
@ -439,16 +439,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "doctrine/lexer",
|
"name": "doctrine/lexer",
|
||||||
"version": "1.2.2",
|
"version": "1.2.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/doctrine/lexer.git",
|
"url": "https://github.com/doctrine/lexer.git",
|
||||||
"reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c"
|
"reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/doctrine/lexer/zipball/9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c",
|
"url": "https://api.github.com/repos/doctrine/lexer/zipball/c268e882d4dbdd85e36e4ad69e02dc284f89d229",
|
||||||
"reference": "9c50f840f257bbb941e6f4a0e94ccf5db5c3f76c",
|
"reference": "c268e882d4dbdd85e36e4ad69e02dc284f89d229",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -456,7 +456,7 @@
|
|||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/coding-standard": "^9.0",
|
"doctrine/coding-standard": "^9.0",
|
||||||
"phpstan/phpstan": "1.3",
|
"phpstan/phpstan": "^1.3",
|
||||||
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
|
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.5",
|
||||||
"vimeo/psalm": "^4.11"
|
"vimeo/psalm": "^4.11"
|
||||||
},
|
},
|
||||||
@ -495,7 +495,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/doctrine/lexer/issues",
|
"issues": "https://github.com/doctrine/lexer/issues",
|
||||||
"source": "https://github.com/doctrine/lexer/tree/1.2.2"
|
"source": "https://github.com/doctrine/lexer/tree/1.2.3"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -511,7 +511,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-12T08:27:12+00:00"
|
"time": "2022-02-28T11:07:21+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "dompdf/dompdf",
|
"name": "dompdf/dompdf",
|
||||||
@ -728,12 +728,12 @@
|
|||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-0": {
|
|
||||||
"HTMLPurifier": "library/"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"library/HTMLPurifier.composer.php"
|
"library/HTMLPurifier.composer.php"
|
||||||
],
|
],
|
||||||
|
"psr-0": {
|
||||||
|
"HTMLPurifier": "library/"
|
||||||
|
},
|
||||||
"exclude-from-classmap": [
|
"exclude-from-classmap": [
|
||||||
"/library/HTMLPurifier/Language/"
|
"/library/HTMLPurifier/Language/"
|
||||||
]
|
]
|
||||||
@ -1093,16 +1093,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "google/apiclient-services",
|
"name": "google/apiclient-services",
|
||||||
"version": "v0.236.0",
|
"version": "v0.237.0",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/googleapis/google-api-php-client-services.git",
|
"url": "https://github.com/googleapis/google-api-php-client-services.git",
|
||||||
"reference": "3aefd2914d9025a881ee93145de16f9e0f82443e"
|
"reference": "c10652adc29b4242237075acde318e83f88ab918"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/3aefd2914d9025a881ee93145de16f9e0f82443e",
|
"url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/c10652adc29b4242237075acde318e83f88ab918",
|
||||||
"reference": "3aefd2914d9025a881ee93145de16f9e0f82443e",
|
"reference": "c10652adc29b4242237075acde318e83f88ab918",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -1131,9 +1131,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
|
"issues": "https://github.com/googleapis/google-api-php-client-services/issues",
|
||||||
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.236.0"
|
"source": "https://github.com/googleapis/google-api-php-client-services/tree/v0.237.0"
|
||||||
},
|
},
|
||||||
"time": "2022-02-07T14:04:26+00:00"
|
"time": "2022-02-23T22:58:02+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "google/auth",
|
"name": "google/auth",
|
||||||
@ -2401,16 +2401,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/commonmark",
|
"name": "league/commonmark",
|
||||||
"version": "2.2.2",
|
"version": "2.2.3",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/commonmark.git",
|
"url": "https://github.com/thephpleague/commonmark.git",
|
||||||
"reference": "13d7751377732637814f0cda0e3f6d3243f9f769"
|
"reference": "47b015bc4e50fd4438c1ffef6139a1fb65d2ab71"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/13d7751377732637814f0cda0e3f6d3243f9f769",
|
"url": "https://api.github.com/repos/thephpleague/commonmark/zipball/47b015bc4e50fd4438c1ffef6139a1fb65d2ab71",
|
||||||
"reference": "13d7751377732637814f0cda0e3f6d3243f9f769",
|
"reference": "47b015bc4e50fd4438c1ffef6139a1fb65d2ab71",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2501,7 +2501,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-02-13T15:00:57+00:00"
|
"time": "2022-02-26T21:24:45+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/config",
|
"name": "league/config",
|
||||||
@ -2587,16 +2587,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/flysystem",
|
"name": "league/flysystem",
|
||||||
"version": "3.0.9",
|
"version": "3.0.10",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/thephpleague/flysystem.git",
|
"url": "https://github.com/thephpleague/flysystem.git",
|
||||||
"reference": "fb0801a60b7f9ea4188f01c25cb48aed26db7fb6"
|
"reference": "bbc5026adb5a423dfcdcecec74c7e15943ff6115"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/fb0801a60b7f9ea4188f01c25cb48aed26db7fb6",
|
"url": "https://api.github.com/repos/thephpleague/flysystem/zipball/bbc5026adb5a423dfcdcecec74c7e15943ff6115",
|
||||||
"reference": "fb0801a60b7f9ea4188f01c25cb48aed26db7fb6",
|
"reference": "bbc5026adb5a423dfcdcecec74c7e15943ff6115",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2604,6 +2604,7 @@
|
|||||||
"php": "^8.0.2"
|
"php": "^8.0.2"
|
||||||
},
|
},
|
||||||
"conflict": {
|
"conflict": {
|
||||||
|
"aws/aws-sdk-php": "3.209.31 || 3.210.0",
|
||||||
"guzzlehttp/guzzle": "<7.0",
|
"guzzlehttp/guzzle": "<7.0",
|
||||||
"guzzlehttp/ringphp": "<1.1.1",
|
"guzzlehttp/ringphp": "<1.1.1",
|
||||||
"symfony/http-client": "<5.2"
|
"symfony/http-client": "<5.2"
|
||||||
@ -2656,7 +2657,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/thephpleague/flysystem/issues",
|
"issues": "https://github.com/thephpleague/flysystem/issues",
|
||||||
"source": "https://github.com/thephpleague/flysystem/tree/3.0.9"
|
"source": "https://github.com/thephpleague/flysystem/tree/3.0.10"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2672,7 +2673,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-02-22T07:37:40+00:00"
|
"time": "2022-02-26T11:09:13+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "league/mime-type-detection",
|
"name": "league/mime-type-detection",
|
||||||
@ -2808,16 +2809,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "maatwebsite/excel",
|
"name": "maatwebsite/excel",
|
||||||
"version": "3.1.36",
|
"version": "3.1.37",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
|
"url": "https://github.com/SpartnerNL/Laravel-Excel.git",
|
||||||
"reference": "eb31f30d72c51c3fb11644b636945accbe50404f"
|
"reference": "49ccd4142d3d7bce492d6bfb9dd9a27b12935408"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/eb31f30d72c51c3fb11644b636945accbe50404f",
|
"url": "https://api.github.com/repos/SpartnerNL/Laravel-Excel/zipball/49ccd4142d3d7bce492d6bfb9dd9a27b12935408",
|
||||||
"reference": "eb31f30d72c51c3fb11644b636945accbe50404f",
|
"reference": "49ccd4142d3d7bce492d6bfb9dd9a27b12935408",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -2870,7 +2871,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/SpartnerNL/Laravel-Excel/issues",
|
"issues": "https://github.com/SpartnerNL/Laravel-Excel/issues",
|
||||||
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.36"
|
"source": "https://github.com/SpartnerNL/Laravel-Excel/tree/3.1.37"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -2882,7 +2883,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-27T18:34:20+00:00"
|
"time": "2022-02-28T10:20:04+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "maennchen/zipstream-php",
|
"name": "maennchen/zipstream-php",
|
||||||
@ -4551,16 +4552,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "psy/psysh",
|
"name": "psy/psysh",
|
||||||
"version": "v0.11.1",
|
"version": "v0.11.2",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/bobthecow/psysh.git",
|
"url": "https://github.com/bobthecow/psysh.git",
|
||||||
"reference": "570292577277f06f590635381a7f761a6cf4f026"
|
"reference": "7f7da640d68b9c9fec819caae7c744a213df6514"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/570292577277f06f590635381a7f761a6cf4f026",
|
"url": "https://api.github.com/repos/bobthecow/psysh/zipball/7f7da640d68b9c9fec819caae7c744a213df6514",
|
||||||
"reference": "570292577277f06f590635381a7f761a6cf4f026",
|
"reference": "7f7da640d68b9c9fec819caae7c744a213df6514",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -4571,6 +4572,9 @@
|
|||||||
"symfony/console": "^6.0 || ^5.0 || ^4.0 || ^3.4",
|
"symfony/console": "^6.0 || ^5.0 || ^4.0 || ^3.4",
|
||||||
"symfony/var-dumper": "^6.0 || ^5.0 || ^4.0 || ^3.4"
|
"symfony/var-dumper": "^6.0 || ^5.0 || ^4.0 || ^3.4"
|
||||||
},
|
},
|
||||||
|
"conflict": {
|
||||||
|
"symfony/console": "4.4.37 || 5.3.14 || 5.3.15 || 5.4.3 || 5.4.4 || 6.0.3 || 6.0.4"
|
||||||
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"bamarni/composer-bin-plugin": "^1.2",
|
"bamarni/composer-bin-plugin": "^1.2",
|
||||||
"hoa/console": "3.17.05.02"
|
"hoa/console": "3.17.05.02"
|
||||||
@ -4620,9 +4624,9 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/bobthecow/psysh/issues",
|
"issues": "https://github.com/bobthecow/psysh/issues",
|
||||||
"source": "https://github.com/bobthecow/psysh/tree/v0.11.1"
|
"source": "https://github.com/bobthecow/psysh/tree/v0.11.2"
|
||||||
},
|
},
|
||||||
"time": "2022-01-03T13:58:38+00:00"
|
"time": "2022-02-28T15:28:54+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "ralouphie/getallheaders",
|
"name": "ralouphie/getallheaders",
|
||||||
@ -4812,12 +4816,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Ramsey\\Uuid\\": "src/"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"src/functions.php"
|
"src/functions.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Ramsey\\Uuid\\": "src/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
@ -5108,16 +5112,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/console",
|
"name": "symfony/console",
|
||||||
"version": "v6.0.3",
|
"version": "v6.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/console.git",
|
"url": "https://github.com/symfony/console.git",
|
||||||
"reference": "22e8efd019c3270c4f79376234a3f8752cd25490"
|
"reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/console/zipball/22e8efd019c3270c4f79376234a3f8752cd25490",
|
"url": "https://api.github.com/repos/symfony/console/zipball/3bebf4108b9e07492a2a4057d207aa5a77d146b1",
|
||||||
"reference": "22e8efd019c3270c4f79376234a3f8752cd25490",
|
"reference": "3bebf4108b9e07492a2a4057d207aa5a77d146b1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -5183,7 +5187,7 @@
|
|||||||
"terminal"
|
"terminal"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/console/tree/v6.0.3"
|
"source": "https://github.com/symfony/console/tree/v6.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -5199,7 +5203,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-26T17:23:29+00:00"
|
"time": "2022-02-25T10:48:52+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/css-selector",
|
"name": "symfony/css-selector",
|
||||||
@ -5629,16 +5633,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/http-foundation",
|
"name": "symfony/http-foundation",
|
||||||
"version": "v6.0.3",
|
"version": "v6.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/http-foundation.git",
|
"url": "https://github.com/symfony/http-foundation.git",
|
||||||
"reference": "ad157299ced81a637fade1efcadd688d6deba5c1"
|
"reference": "b460fb15905eef449c4c43a4f0c113eccee103b9"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/ad157299ced81a637fade1efcadd688d6deba5c1",
|
"url": "https://api.github.com/repos/symfony/http-foundation/zipball/b460fb15905eef449c4c43a4f0c113eccee103b9",
|
||||||
"reference": "ad157299ced81a637fade1efcadd688d6deba5c1",
|
"reference": "b460fb15905eef449c4c43a4f0c113eccee103b9",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -5681,7 +5685,7 @@
|
|||||||
"description": "Defines an object-oriented layer for the HTTP specification",
|
"description": "Defines an object-oriented layer for the HTTP specification",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/http-foundation/tree/v6.0.3"
|
"source": "https://github.com/symfony/http-foundation/tree/v6.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -5697,20 +5701,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-02T09:55:41+00:00"
|
"time": "2022-02-21T17:15:17+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/http-kernel",
|
"name": "symfony/http-kernel",
|
||||||
"version": "v6.0.4",
|
"version": "v6.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/http-kernel.git",
|
"url": "https://github.com/symfony/http-kernel.git",
|
||||||
"reference": "9dce179ce52b0f4f669c07fd5e465e5d809a5d3b"
|
"reference": "5ad3f5e5fa772a8b5c6bb217f8379b533afac2ba"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/9dce179ce52b0f4f669c07fd5e465e5d809a5d3b",
|
"url": "https://api.github.com/repos/symfony/http-kernel/zipball/5ad3f5e5fa772a8b5c6bb217f8379b533afac2ba",
|
||||||
"reference": "9dce179ce52b0f4f669c07fd5e465e5d809a5d3b",
|
"reference": "5ad3f5e5fa772a8b5c6bb217f8379b533afac2ba",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -5790,7 +5794,7 @@
|
|||||||
"description": "Provides a structured process for converting a Request into a Response",
|
"description": "Provides a structured process for converting a Request into a Response",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/http-kernel/tree/v6.0.4"
|
"source": "https://github.com/symfony/http-kernel/tree/v6.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -5806,20 +5810,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-29T18:12:46+00:00"
|
"time": "2022-02-28T08:05:03+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/mailer",
|
"name": "symfony/mailer",
|
||||||
"version": "v6.0.3",
|
"version": "v6.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/mailer.git",
|
"url": "https://github.com/symfony/mailer.git",
|
||||||
"reference": "d958befe7dbee9d2b2157ef6dfa9b103efa94f82"
|
"reference": "0f4772db6521a1beb44529aa2c0c1e56f671be8f"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/mailer/zipball/d958befe7dbee9d2b2157ef6dfa9b103efa94f82",
|
"url": "https://api.github.com/repos/symfony/mailer/zipball/0f4772db6521a1beb44529aa2c0c1e56f671be8f",
|
||||||
"reference": "d958befe7dbee9d2b2157ef6dfa9b103efa94f82",
|
"reference": "0f4772db6521a1beb44529aa2c0c1e56f671be8f",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -5864,7 +5868,7 @@
|
|||||||
"description": "Helps sending emails",
|
"description": "Helps sending emails",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/mailer/tree/v6.0.3"
|
"source": "https://github.com/symfony/mailer/tree/v6.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -5880,7 +5884,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-02T09:55:41+00:00"
|
"time": "2022-02-25T10:48:52+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/mime",
|
"name": "symfony/mime",
|
||||||
@ -5997,12 +6001,12 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Polyfill\\Ctype\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"bootstrap.php"
|
"bootstrap.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Polyfill\\Ctype\\": ""
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
@ -6620,16 +6624,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/process",
|
"name": "symfony/process",
|
||||||
"version": "v6.0.3",
|
"version": "v6.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/process.git",
|
"url": "https://github.com/symfony/process.git",
|
||||||
"reference": "298ed357274c1868c20a0061df256a1250a6c4af"
|
"reference": "1ccceccc6497e96f4f646218f04b97ae7d9fa7a1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/process/zipball/298ed357274c1868c20a0061df256a1250a6c4af",
|
"url": "https://api.github.com/repos/symfony/process/zipball/1ccceccc6497e96f4f646218f04b97ae7d9fa7a1",
|
||||||
"reference": "298ed357274c1868c20a0061df256a1250a6c4af",
|
"reference": "1ccceccc6497e96f4f646218f04b97ae7d9fa7a1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -6661,7 +6665,7 @@
|
|||||||
"description": "Executes commands in sub-processes",
|
"description": "Executes commands in sub-processes",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/process/tree/v6.0.3"
|
"source": "https://github.com/symfony/process/tree/v6.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -6677,20 +6681,20 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-26T17:23:29+00:00"
|
"time": "2022-01-30T18:19:12+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/routing",
|
"name": "symfony/routing",
|
||||||
"version": "v6.0.3",
|
"version": "v6.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/routing.git",
|
"url": "https://github.com/symfony/routing.git",
|
||||||
"reference": "b1debdf7a40e6bc7eee0f363ab9dd667fe04f099"
|
"reference": "a738b152426ac7fcb94bdab8188264652238bef1"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/routing/zipball/b1debdf7a40e6bc7eee0f363ab9dd667fe04f099",
|
"url": "https://api.github.com/repos/symfony/routing/zipball/a738b152426ac7fcb94bdab8188264652238bef1",
|
||||||
"reference": "b1debdf7a40e6bc7eee0f363ab9dd667fe04f099",
|
"reference": "a738b152426ac7fcb94bdab8188264652238bef1",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -6749,7 +6753,7 @@
|
|||||||
"url"
|
"url"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/routing/tree/v6.0.3"
|
"source": "https://github.com/symfony/routing/tree/v6.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -6765,7 +6769,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-02T09:55:41+00:00"
|
"time": "2022-01-31T19:46:53+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/service-contracts",
|
"name": "symfony/service-contracts",
|
||||||
@ -6881,12 +6885,12 @@
|
|||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Symfony\\Component\\String\\": ""
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"Resources/functions.php"
|
"Resources/functions.php"
|
||||||
],
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Symfony\\Component\\String\\": ""
|
||||||
|
},
|
||||||
"exclude-from-classmap": [
|
"exclude-from-classmap": [
|
||||||
"/Tests/"
|
"/Tests/"
|
||||||
]
|
]
|
||||||
@ -6936,16 +6940,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/translation",
|
"name": "symfony/translation",
|
||||||
"version": "v6.0.3",
|
"version": "v6.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/translation.git",
|
"url": "https://github.com/symfony/translation.git",
|
||||||
"reference": "71bb15335798f8c4da110911bcf2d2fead7a430d"
|
"reference": "e69501c71107cc3146b32aaa45f4edd0c3427875"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/translation/zipball/71bb15335798f8c4da110911bcf2d2fead7a430d",
|
"url": "https://api.github.com/repos/symfony/translation/zipball/e69501c71107cc3146b32aaa45f4edd0c3427875",
|
||||||
"reference": "71bb15335798f8c4da110911bcf2d2fead7a430d",
|
"reference": "e69501c71107cc3146b32aaa45f4edd0c3427875",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -7011,7 +7015,7 @@
|
|||||||
"description": "Provides tools to internationalize your application",
|
"description": "Provides tools to internationalize your application",
|
||||||
"homepage": "https://symfony.com",
|
"homepage": "https://symfony.com",
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/translation/tree/v6.0.3"
|
"source": "https://github.com/symfony/translation/tree/v6.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -7027,7 +7031,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-07T00:29:03+00:00"
|
"time": "2022-02-09T15:52:48+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/translation-contracts",
|
"name": "symfony/translation-contracts",
|
||||||
@ -7109,16 +7113,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "symfony/var-dumper",
|
"name": "symfony/var-dumper",
|
||||||
"version": "v6.0.3",
|
"version": "v6.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/symfony/var-dumper.git",
|
"url": "https://github.com/symfony/var-dumper.git",
|
||||||
"reference": "7b701676fc64f9ef11f9b4870f16b48f66be4834"
|
"reference": "60d6a756d5f485df5e6e40b337334848f79f61ce"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/7b701676fc64f9ef11f9b4870f16b48f66be4834",
|
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/60d6a756d5f485df5e6e40b337334848f79f61ce",
|
||||||
"reference": "7b701676fc64f9ef11f9b4870f16b48f66be4834",
|
"reference": "60d6a756d5f485df5e6e40b337334848f79f61ce",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -7177,7 +7181,7 @@
|
|||||||
"dump"
|
"dump"
|
||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"source": "https://github.com/symfony/var-dumper/tree/v6.0.3"
|
"source": "https://github.com/symfony/var-dumper/tree/v6.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -7193,7 +7197,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-01-17T16:30:44+00:00"
|
"time": "2022-02-21T17:15:17+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "tijsverkoyen/css-to-inline-styles",
|
"name": "tijsverkoyen/css-to-inline-styles",
|
||||||
@ -7929,6 +7933,9 @@
|
|||||||
"require": {
|
"require": {
|
||||||
"php": "^7.1 || ^8.0"
|
"php": "^7.1 || ^8.0"
|
||||||
},
|
},
|
||||||
|
"replace": {
|
||||||
|
"myclabs/deep-copy": "self.version"
|
||||||
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"doctrine/collections": "^1.0",
|
"doctrine/collections": "^1.0",
|
||||||
"doctrine/common": "^2.6",
|
"doctrine/common": "^2.6",
|
||||||
@ -8204,12 +8211,12 @@
|
|||||||
},
|
},
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
|
||||||
"Facebook\\WebDriver\\": "lib/"
|
|
||||||
},
|
|
||||||
"files": [
|
"files": [
|
||||||
"lib/Exception/TimeoutException.php"
|
"lib/Exception/TimeoutException.php"
|
||||||
]
|
],
|
||||||
|
"psr-4": {
|
||||||
|
"Facebook\\WebDriver\\": "lib/"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"notification-url": "https://packagist.org/downloads/",
|
"notification-url": "https://packagist.org/downloads/",
|
||||||
"license": [
|
"license": [
|
||||||
@ -8459,16 +8466,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-code-coverage",
|
"name": "phpunit/php-code-coverage",
|
||||||
"version": "9.2.13",
|
"version": "9.2.14",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
|
||||||
"reference": "deac8540cb7bd40b2b8cfa679b76202834fd04e8"
|
"reference": "9f4d60b6afe5546421462b76cd4e633ebc364ab4"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/deac8540cb7bd40b2b8cfa679b76202834fd04e8",
|
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/9f4d60b6afe5546421462b76cd4e633ebc364ab4",
|
||||||
"reference": "deac8540cb7bd40b2b8cfa679b76202834fd04e8",
|
"reference": "9f4d60b6afe5546421462b76cd4e633ebc364ab4",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -8524,7 +8531,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
"issues": "https://github.com/sebastianbergmann/php-code-coverage/issues",
|
||||||
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.13"
|
"source": "https://github.com/sebastianbergmann/php-code-coverage/tree/9.2.14"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -8532,7 +8539,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-02-23T17:02:38+00:00"
|
"time": "2022-02-28T12:38:02+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/php-file-iterator",
|
"name": "phpunit/php-file-iterator",
|
||||||
@ -9906,16 +9913,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "spatie/flare-client-php",
|
"name": "spatie/flare-client-php",
|
||||||
"version": "1.0.2",
|
"version": "1.0.5",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/spatie/flare-client-php.git",
|
"url": "https://github.com/spatie/flare-client-php.git",
|
||||||
"reference": "5d48e00716e3bab813cafffe223bc85c5732a410"
|
"reference": "8ada1e5f4d7a2869f491c5e75d1f689b69db423e"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/5d48e00716e3bab813cafffe223bc85c5732a410",
|
"url": "https://api.github.com/repos/spatie/flare-client-php/zipball/8ada1e5f4d7a2869f491c5e75d1f689b69db423e",
|
||||||
"reference": "5d48e00716e3bab813cafffe223bc85c5732a410",
|
"reference": "8ada1e5f4d7a2869f491c5e75d1f689b69db423e",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@ -9958,7 +9965,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/spatie/flare-client-php/issues",
|
"issues": "https://github.com/spatie/flare-client-php/issues",
|
||||||
"source": "https://github.com/spatie/flare-client-php/tree/1.0.2"
|
"source": "https://github.com/spatie/flare-client-php/tree/1.0.5"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@ -9966,7 +9973,7 @@
|
|||||||
"type": "github"
|
"type": "github"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2022-02-16T16:14:24+00:00"
|
"time": "2022-03-01T10:52:59+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "spatie/ignition",
|
"name": "spatie/ignition",
|
||||||
@ -10242,5 +10249,5 @@
|
|||||||
"ext-pdo": "*"
|
"ext-pdo": "*"
|
||||||
},
|
},
|
||||||
"platform-dev": [],
|
"platform-dev": [],
|
||||||
"plugin-api-version": "2.2.0"
|
"plugin-api-version": "2.1.0"
|
||||||
}
|
}
|
||||||
|
@ -28,4 +28,25 @@ class UserFactory extends Factory
|
|||||||
"remember_token" => Str::random(10),
|
"remember_token" => Str::random(10),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function admin(): static
|
||||||
|
{
|
||||||
|
return $this->state([
|
||||||
|
"role" => Role::Administrator,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function technicalApprover(): static
|
||||||
|
{
|
||||||
|
return $this->state([
|
||||||
|
"role" => Role::TechnicalApprover,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function administrativeApprover(): static
|
||||||
|
{
|
||||||
|
return $this->state([
|
||||||
|
"role" => Role::AdministrativeApprover,
|
||||||
|
]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
Kalendarz urlopów
|
Kalendarz urlopów
|
||||||
</h2>
|
</h2>
|
||||||
</div>
|
</div>
|
||||||
<div>
|
<div v-if="can.generateTimesheet">
|
||||||
<a
|
<a
|
||||||
:href="`/timesheet/${selectedMonth.value}`"
|
:href="`/timesheet/${selectedMonth.value}`"
|
||||||
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||||
@ -164,6 +164,10 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => null,
|
default: () => null,
|
||||||
},
|
},
|
||||||
|
can: {
|
||||||
|
type: Object,
|
||||||
|
default: () => null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const {getMonths, findMonth} = useMonthInfo()
|
const {getMonths, findMonth} = useMonthInfo()
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
Lista dni wolnych od pracy w danym roku
|
Lista dni wolnych od pracy w danym roku
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div v-if="can.create">
|
<div v-if="can.manageHolidays">
|
||||||
<InertiaLink
|
<InertiaLink
|
||||||
href="holidays/create"
|
href="holidays/create"
|
||||||
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
class="inline-flex items-center px-4 py-3 border border-transparent text-sm leading-4 font-medium rounded-md shadow-sm text-white bg-blumilk-600 hover:bg-blumilk-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blumilk-500"
|
||||||
@ -65,6 +65,7 @@
|
|||||||
</td>
|
</td>
|
||||||
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500 text-right">
|
<td class="px-4 py-4 whitespace-nowrap text-sm text-gray-500 text-right">
|
||||||
<Menu
|
<Menu
|
||||||
|
v-if="can.manageHolidays"
|
||||||
as="div"
|
as="div"
|
||||||
class="relative inline-block text-left"
|
class="relative inline-block text-left"
|
||||||
>
|
>
|
||||||
|
@ -29,6 +29,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<Listbox
|
<Listbox
|
||||||
|
v-if="can.createOnBehalfOfEmployee"
|
||||||
v-model="form.user"
|
v-model="form.user"
|
||||||
as="div"
|
as="div"
|
||||||
class="sm:grid sm:grid-cols-3 py-4 items-center"
|
class="sm:grid sm:grid-cols-3 py-4 items-center"
|
||||||
@ -231,7 +232,10 @@
|
|||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="sm:grid sm:grid-cols-3 py-4 items-center">
|
<div
|
||||||
|
v-if="can.skipFlow"
|
||||||
|
class="sm:grid sm:grid-cols-3 py-4 items-center"
|
||||||
|
>
|
||||||
<label
|
<label
|
||||||
for="flowSkipped"
|
for="flowSkipped"
|
||||||
class="block text-sm font-medium text-gray-700"
|
class="block text-sm font-medium text-gray-700"
|
||||||
@ -311,10 +315,16 @@ export default {
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: () => null,
|
default: () => null,
|
||||||
},
|
},
|
||||||
|
can: {
|
||||||
|
type: Object,
|
||||||
|
default: () => null,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
setup(props) {
|
setup(props) {
|
||||||
const form = useForm({
|
const form = useForm({
|
||||||
user: props.users.data.find(user => user.id === props.auth.user.id),
|
user: props.can.createOnBehalfOfEmployee
|
||||||
|
? props.users.data.find(user => user.id === props.auth.user.id)
|
||||||
|
: props.auth.user,
|
||||||
from: null,
|
from: null,
|
||||||
to: null,
|
to: null,
|
||||||
type: props.vacationTypes[0],
|
type: props.vacationTypes[0],
|
||||||
|
@ -213,12 +213,12 @@
|
|||||||
>
|
>
|
||||||
<img
|
<img
|
||||||
class="h-8 w-8 rounded-full"
|
class="h-8 w-8 rounded-full"
|
||||||
:src="user.avatar"
|
:src="auth.user.avatar"
|
||||||
alt="Avatar"
|
alt="Avatar"
|
||||||
>
|
>
|
||||||
<span class="hidden ml-3 text-gray-700 text-sm font-medium lg:block">
|
<span class="hidden ml-3 text-gray-700 text-sm font-medium lg:block">
|
||||||
<span class="sr-only">Open user menu for </span>
|
<span class="sr-only">Open user menu for </span>
|
||||||
{{ user.name }}
|
{{ auth.user.name }}
|
||||||
</span>
|
</span>
|
||||||
<ChevronDownIcon
|
<ChevronDownIcon
|
||||||
class="hidden flex-shrink-0 ml-1 h-5 w-5 text-gray-400 lg:block"
|
class="hidden flex-shrink-0 ml-1 h-5 w-5 text-gray-400 lg:block"
|
||||||
@ -324,16 +324,17 @@ export default {
|
|||||||
setup() {
|
setup() {
|
||||||
const sidebarOpen = ref(false)
|
const sidebarOpen = ref(false)
|
||||||
|
|
||||||
const user = computed(() => usePage().props.value.auth.user)
|
const auth = computed(() => usePage().props.value.auth)
|
||||||
const years = computed(() => usePage().props.value.years)
|
const years = computed(() => usePage().props.value.years)
|
||||||
|
|
||||||
const navigation = [
|
const navigation = computed(() =>
|
||||||
{name: 'Wnioski urlopowe', href: '/vacation-requests', icon: CollectionIcon},
|
[
|
||||||
{name: 'Kalendarz urlopów', href: '/vacation-calendar', icon: CalendarIcon},
|
{name: 'Wnioski urlopowe', href: '/vacation-requests', icon: CollectionIcon, can: true},
|
||||||
{name: 'Dni wolne', href: '/holidays', icon: StarIcon},
|
{name: 'Kalendarz urlopów', href: '/vacation-calendar', icon: CalendarIcon, can: true},
|
||||||
{name: 'Limity urlopów', href: '/vacation-limits', icon: SunIcon},
|
{name: 'Dni wolne', href: '/holidays', icon: StarIcon, can: true},
|
||||||
{name: 'Użytkownicy', href: '/users', icon: UserGroupIcon},
|
{name: 'Limity urlopów', href: '/vacation-limits', icon: SunIcon, can: auth.value.can.manageVacationLimits},
|
||||||
]
|
{name: 'Użytkownicy', href: '/users', icon: UserGroupIcon, can: auth.value.can.manageUsers},
|
||||||
|
].filter(item => item.can))
|
||||||
|
|
||||||
const userNavigation = [
|
const userNavigation = [
|
||||||
{name: 'Your Profile', href: '#'},
|
{name: 'Your Profile', href: '#'},
|
||||||
@ -342,7 +343,7 @@ export default {
|
|||||||
]
|
]
|
||||||
|
|
||||||
return {
|
return {
|
||||||
user,
|
auth,
|
||||||
years,
|
years,
|
||||||
navigation,
|
navigation,
|
||||||
userNavigation,
|
userNavigation,
|
||||||
|
@ -34,7 +34,8 @@ class HolidayTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanCreateHoliday(): void
|
public function testAdminCanCreateHoliday(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
$this->actingAs($admin)
|
$this->actingAs($admin)
|
||||||
@ -53,7 +54,8 @@ class HolidayTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCannotCreateHolidayForYearPeriodThatDoesntExist(): void
|
public function testAdminCannotCreateHolidayForYearPeriodThatDoesntExist(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$year = YearPeriod::query()->max("year") + 1;
|
$year = YearPeriod::query()->max("year") + 1;
|
||||||
|
|
||||||
$this->actingAs($admin)
|
$this->actingAs($admin)
|
||||||
@ -66,7 +68,8 @@ class HolidayTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCannotCreateHolidayIfGivenDataIsUsed(): void
|
public function testAdminCannotCreateHolidayIfGivenDataIsUsed(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
$sameDate = Carbon::create($currentYearPeriod->year, 5, 20)->toDateString();
|
$sameDate = Carbon::create($currentYearPeriod->year, 5, 20)->toDateString();
|
||||||
|
|
||||||
@ -85,7 +88,8 @@ class HolidayTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanEditHoliday(): void
|
public function testAdminCanEditHoliday(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
$holiday = Holiday::factory()->create([
|
$holiday = Holiday::factory()->create([
|
||||||
@ -115,7 +119,8 @@ class HolidayTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanDeleteHoliday(): void
|
public function testAdminCanDeleteHoliday(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$holiday = Holiday::factory()->create();
|
$holiday = Holiday::factory()->create();
|
||||||
|
|
||||||
$this->actingAs($admin)
|
$this->actingAs($admin)
|
||||||
|
@ -19,7 +19,7 @@ class UserTest extends FeatureTestCase
|
|||||||
public function testAdminCanSeeUsersList(): void
|
public function testAdminCanSeeUsersList(): void
|
||||||
{
|
{
|
||||||
User::factory()->count(10)->create();
|
User::factory()->count(10)->create();
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$this->assertDatabaseCount("users", 11);
|
$this->assertDatabaseCount("users", 11);
|
||||||
|
|
||||||
@ -38,18 +38,21 @@ class UserTest extends FeatureTestCase
|
|||||||
"first_name" => "Test",
|
"first_name" => "Test",
|
||||||
"last_name" => "User1",
|
"last_name" => "User1",
|
||||||
])->create();
|
])->create();
|
||||||
|
|
||||||
User::factory([
|
User::factory([
|
||||||
"first_name" => "Test",
|
"first_name" => "Test",
|
||||||
"last_name" => "User2",
|
"last_name" => "User2",
|
||||||
])->create();
|
])->create();
|
||||||
|
|
||||||
User::factory([
|
User::factory([
|
||||||
"first_name" => "Test",
|
"first_name" => "Test",
|
||||||
"last_name" => "User3",
|
"last_name" => "User3",
|
||||||
])->create();
|
])->create();
|
||||||
|
|
||||||
$admin = User::factory([
|
$admin = User::factory([
|
||||||
"first_name" => "John",
|
"first_name" => "John",
|
||||||
"last_name" => "Doe",
|
"last_name" => "Doe",
|
||||||
])->create();
|
])->admin()->create();
|
||||||
|
|
||||||
$this->assertDatabaseCount("users", 4);
|
$this->assertDatabaseCount("users", 4);
|
||||||
|
|
||||||
@ -66,7 +69,7 @@ class UserTest extends FeatureTestCase
|
|||||||
public function testUserListIsPaginated(): void
|
public function testUserListIsPaginated(): void
|
||||||
{
|
{
|
||||||
User::factory()->count(15)->create();
|
User::factory()->count(15)->create();
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$this->assertDatabaseCount("users", 16);
|
$this->assertDatabaseCount("users", 16);
|
||||||
|
|
||||||
@ -81,7 +84,7 @@ class UserTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanCreateUser(): void
|
public function testAdminCanCreateUser(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
Carbon::setTestNow(Carbon::now());
|
Carbon::setTestNow(Carbon::now());
|
||||||
|
|
||||||
$this->actingAs($admin)
|
$this->actingAs($admin)
|
||||||
@ -109,7 +112,8 @@ class UserTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanEditUser(): void
|
public function testAdminCanEditUser(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
|
|
||||||
Carbon::setTestNow();
|
Carbon::setTestNow();
|
||||||
@ -147,7 +151,8 @@ class UserTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanDeleteUser(): void
|
public function testAdminCanDeleteUser(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
|
|
||||||
$this->actingAs($admin)
|
$this->actingAs($admin)
|
||||||
@ -159,7 +164,8 @@ class UserTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanRestoreUser(): void
|
public function testAdminCanRestoreUser(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->create();
|
$admin = User::factory()->admin()->create();
|
||||||
|
|
||||||
$user = User::factory()->create();
|
$user = User::factory()->create();
|
||||||
$user->delete();
|
$user->delete();
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ class VacationLimitTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanSeeVacationLimits(): void
|
public function testAdminCanSeeVacationLimits(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->createQuietly();
|
$admin = User::factory()->admin()->createQuietly();
|
||||||
|
|
||||||
User::factory(10)->create();
|
User::factory(10)->create();
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ class VacationLimitTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testAdminCanUpdateVacationLimits(): void
|
public function testAdminCanUpdateVacationLimits(): void
|
||||||
{
|
{
|
||||||
$admin = User::factory()->createQuietly();
|
$admin = User::factory()->admin()->createQuietly();
|
||||||
|
|
||||||
User::factory(3)->create();
|
User::factory(3)->create();
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
|
|
||||||
public function testUserCanCreateVacationRequestOnEmployeeBehalf(): void
|
public function testUserCanCreateVacationRequestOnEmployeeBehalf(): void
|
||||||
{
|
{
|
||||||
$creator = User::factory()->createQuietly();
|
$creator = User::factory()->admin()->createQuietly();
|
||||||
$user = User::factory()->createQuietly();
|
$user = User::factory()->createQuietly();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
@ -134,7 +134,7 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
{
|
{
|
||||||
Event::fake(VacationRequestApproved::class);
|
Event::fake(VacationRequestApproved::class);
|
||||||
|
|
||||||
$creator = User::factory()->createQuietly();
|
$creator = User::factory()->admin()->createQuietly();
|
||||||
$user = User::factory()->createQuietly();
|
$user = User::factory()->createQuietly();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
@ -175,7 +175,7 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
Event::fake(VacationRequestAcceptedByTechnical::class);
|
Event::fake(VacationRequestAcceptedByTechnical::class);
|
||||||
|
|
||||||
$user = User::factory()->createQuietly();
|
$user = User::factory()->createQuietly();
|
||||||
$technicalApprover = User::factory()->createQuietly();
|
$technicalApprover = User::factory()->technicalApprover()->createQuietly();
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
$vacationRequest = VacationRequest::factory([
|
$vacationRequest = VacationRequest::factory([
|
||||||
@ -198,7 +198,7 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
Event::fake(VacationRequestAcceptedByAdministrative::class);
|
Event::fake(VacationRequestAcceptedByAdministrative::class);
|
||||||
|
|
||||||
$user = User::factory()->createQuietly();
|
$user = User::factory()->createQuietly();
|
||||||
$administrativeApprover = User::factory()->createQuietly();
|
$administrativeApprover = User::factory()->administrativeApprover()->createQuietly();
|
||||||
|
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
@ -221,7 +221,7 @@ class VacationRequestTest extends FeatureTestCase
|
|||||||
Event::fake(VacationRequestRejected::class);
|
Event::fake(VacationRequestRejected::class);
|
||||||
|
|
||||||
$user = User::factory()->createQuietly();
|
$user = User::factory()->createQuietly();
|
||||||
$technicalApprover = User::factory()->createQuietly();
|
$technicalApprover = User::factory()->technicalApprover()->createQuietly();
|
||||||
$currentYearPeriod = YearPeriod::current();
|
$currentYearPeriod = YearPeriod::current();
|
||||||
|
|
||||||
VacationLimit::factory([
|
VacationLimit::factory([
|
||||||
|
Loading…
x
Reference in New Issue
Block a user