<?php

namespace App\Policies;

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

class SlidePolicy
{
    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, Slide $slide)
    {
        //
        return $admin->hasPermission('slide.view');
    }


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


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


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