ldc-crm/app/Policies/QuestionPolicy.php
2023-06-23 17:18:59 +02:00

74 lines
1.2 KiB
PHP

<?php
namespace App\Policies;
use App\Models\Question;
use App\Models\Service;
use App\Policies\Rules\UserStaticRules as USR;
/**
* @codeCoverageIgnore
*/
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;
}
}