major ui updates
This commit is contained in:
@@ -9,13 +9,11 @@ use Modules\Helpdesk\Models\Ticket;
|
||||
|
||||
final class TicketPolicy
|
||||
{
|
||||
/** @return bool */
|
||||
public function viewAny(User $user): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @return bool */
|
||||
public function view(User $user, Ticket $ticket): bool
|
||||
{
|
||||
return (bool) ($user->helpdesk_admin ?? false)
|
||||
@@ -23,25 +21,21 @@ final class TicketPolicy
|
||||
|| (int) $ticket->user_id === (int) $user->id;
|
||||
}
|
||||
|
||||
/** @return bool */
|
||||
public function create(User $user): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/** @return bool */
|
||||
public function update(User $user, Ticket $ticket): bool
|
||||
{
|
||||
return (bool) ($user->helpdesk_admin ?? false) || (int) $ticket->agent_id === (int) $user->id;
|
||||
}
|
||||
|
||||
/** @return bool */
|
||||
public function comment(User $user, Ticket $ticket): bool
|
||||
{
|
||||
return $this->view($user, $ticket);
|
||||
}
|
||||
|
||||
/** @return bool */
|
||||
public function delete(User $user, Ticket $ticket): bool
|
||||
{
|
||||
return (bool) ($user->helpdesk_admin ?? false);
|
||||
|
||||
Reference in New Issue
Block a user