A reply starts from a template filled in the language the person wrote in, is sent by the application when it has a mailer that delivers or handed to the replier's mail program otherwise, and is recorded on the submission. The same is available through the API. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
45 lines
922 B
PHP
45 lines
922 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\User;
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
/**
|
|
* Templates belong to the inbox: whoever answers it may write them.
|
|
*/
|
|
class ReplyTemplatePolicy
|
|
{
|
|
public function viewAny(User $user): bool
|
|
{
|
|
return $user->can('applications.view_any');
|
|
}
|
|
|
|
public function view(User $user, Model $model): bool
|
|
{
|
|
return $user->can('applications.view_any');
|
|
}
|
|
|
|
public function create(User $user): bool
|
|
{
|
|
return $user->can('applications.update');
|
|
}
|
|
|
|
public function update(User $user, Model $model): bool
|
|
{
|
|
return $user->can('applications.update');
|
|
}
|
|
|
|
public function delete(User $user, Model $model): bool
|
|
{
|
|
return $user->can('applications.update');
|
|
}
|
|
|
|
public function deleteAny(User $user): bool
|
|
{
|
|
return $user->can('applications.update');
|
|
}
|
|
}
|