Answer the inbox from the panel, with templates

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>
This commit is contained in:
2026-10-01 10:45:47 +02:00
parent 697d333ad4
commit 76d022053b
27 changed files with 1096 additions and 0 deletions

View File

@@ -0,0 +1,44 @@
<?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');
}
}