# fluent-support/1.10.2/app/Http/Policies/AgentTicketPolicy.php

Fluent Support – Helpdesk &amp; Customer Support Ticket System, version 1.10.2. 36 lines.

- Page: https://pluginprobe.com/plugins/fluent-support/1.10.2/code/app/Http/Policies/AgentTicketPolicy.php
- Raw: https://pluginprobe.com/plugins/fluent-support/1.10.2/raw/app/Http/Policies/AgentTicketPolicy.php
- Modified: 2024-05-28T13:07:24+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/fluent-support/1.10.2/code/app/Http/Policies/AgentTicketPolicy.php#L10-L20`.

```php
<?php

namespace FluentSupport\App\Http\Policies;

use FluentSupport\App\Modules\PermissionManager;
use FluentSupport\Framework\Request\Request;
use FluentSupport\Framework\Foundation\Policy;

class AgentTicketPolicy extends Policy
{
    /**
     * Check user permission for any method
     * @param \FluentSupport\Framework\Request\Request $request
     * @return Boolean
     */
    public function verifyRequest(Request $request)
    {
        $permissions = PermissionManager::currentUserPermissions();
        $acceptedPermissions = ['fst_manage_own_tickets', 'fst_manage_unassigned_tickets', 'fst_manage_other_tickets', 'fst_merge_tickets','fst_draft_reply'];
        $status = !!array_intersect($permissions, $acceptedPermissions);

        return apply_filters('fluent_support/agent_has_access', $status, $request);
    }

    public function doBulkActions(Request $request)
    {
        $action = $request->get('bulk_action');

        if ($action == 'delete_tickets') {
            return PermissionManager::currentUserCan('fst_delete_tickets');
        }

        return $this->verifyRequest($request);
    }
}

```
