<?php

namespace App\Policies;

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

class CarouselPolicy
{
    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, Carousel $carousel)
    {
        //
        return $admin->hasPermission('carousel.view');
    }


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


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


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


}
