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

Fluent Support – Helpdesk &amp; Customer Support Ticket System, version 1.5.0. 35 lines.

- Page: https://pluginprobe.com/plugins/fluent-support/1.5.0/code/app/Http/Policies/AgentTicketPolicy.php
- Raw: https://pluginprobe.com/plugins/fluent-support/1.5.0/raw/app/Http/Policies/AgentTicketPolicy.php
- Modified: 2021-11-12T14:57:38+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.5.0/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'];

        return !!array_intersect($permissions, $acceptedPermissions);
    }

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

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

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

```
