<?php

namespace App\Policies;

use App\Admin;
use App\Brand;
use Illuminate\Auth\Access\HandlesAuthorization;

class BrandPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }


    public function before(Admin $admin)
    {
        if ($admin->isSuperAdmin()) {
            return true;
        }
    }

    
    public function view(Admin $admin, Brand $brand)
    {
        //
        return $admin->hasPermission('brand.view');
    }

    
    public function create(Admin $admin)
    {
        //
        return $admin->hasPermission('brand.create');
    }

   
    public function update(Admin $admin, Brand $brand)
    {
        //
        return $admin->hasPermission('brand.update');
    }

    
    public function delete(Admin $admin, Brand $brand)
    {
        //
        return $admin->hasPermission('brand.delete');
    }

    
}
