<?php

namespace App\Policies;

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

class AdPolicy
{
    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, Ad $ad)
    {
        //
        return $admin->hasPermission('ad.view');
    }


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


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


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



}
