27 lines
691 B
PHP
27 lines
691 B
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\Application;
|
|
use App\Models\User;
|
|
use App\Services\Ppm\PpmScopeService;
|
|
|
|
class ApplicationPolicy
|
|
{
|
|
public function view(User $user, Application $application): bool
|
|
{
|
|
return app(PpmScopeService::class)->canAccessApplication($user, $application);
|
|
}
|
|
|
|
public function review(User $user, Application $application): bool
|
|
{
|
|
return $this->view($user, $application)
|
|
&& in_array($application->status, ['submitted', 'under_ppm_review', 'approved'], true);
|
|
}
|
|
|
|
public function downloadDocument(User $user, Application $application): bool
|
|
{
|
|
return $this->view($user, $application);
|
|
}
|
|
}
|