<?php

namespace App\Policies;

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

class PositionPolicy
{
    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, Position $position)
    {
        //
        return $admin->hasPermission('position.view');
    }


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


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


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