ldc-crm/app/Policies/QuestionPolicy.php
Alexis Gousseau 303834bbca
Crm V4
- Make all tests pass Client (V4),CRMV2,CRMV4
- Simplify client submodule path
- Move App_url to .env.testing
2023-10-06 16:37:29 +02:00

72 lines
1.2 KiB
PHP

<?php
namespace App\Policies;
use App\Models\Question;
use App\Models\Service;
use App\Policies\Rules\UserStaticRules as USR;
class QuestionPolicy
{
/**
* View a Question.
*
* @return boolean
*/
public function view(): bool
{
return USR::everyOne();
}
/**
* ViewAny a Question.
*
* @return boolean
*/
public function viewAny(): bool
{
return USR::everyOne();
}
/**
* Create a Question.
*
* @return boolean
*/
public function create(): bool
{
return USR::everyOne();
}
/**
* Update a Question.
*
* @return boolean
*/
public function update(): bool
{
return USR::everyOne();
}
/**
* Delete a Question.
*
* @return boolean
*/
public function delete(): bool
{
return USR::everyOne();
}
/**
* Check if the question belongs to the service.
*
* @param \App\Models\Service $service
* @param \App\Models\Question $question
* @return boolean
*/
public function questionBelongsToService(Service $service, Question $question)
{
return $service->brand->id === $question->brand_id;
}
}