<?php

namespace App\Policies;

use App\Models\User;
use Illuminate\Auth\Access\HandlesAuthorization;
use Laravel\Nova\Http\Requests\NovaRequest;
use Laravel\Nova\Nova;

class SiteFoundersPolicy
{
    use HandlesAuthorization;

    /**
     * Create a new policy instance.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }
    public function create(User $user){
        return Nova::whenServing(function (NovaRequest $request) use ($user) {
            return $user->hasAnyPermission(['control founders']);
        });
    }
    public function update(User $user){
        return Nova::whenServing(function (NovaRequest $request) use ($user) {
            return $user->hasAnyPermission(['control founders']);
        });
    }
    public function view(User $user){
        return Nova::whenServing(function (NovaRequest $request) use ($user) {
            return $user->hasAnyPermission(['control founders']);
        });
    }
    public function delete(User $user,){
        return Nova::whenServing(function (NovaRequest $request) use ($user) {
            return $user->hasAnyPermission(['control founders']);
        });
    }
    public function viewAny(User $user){
        return Nova::whenServing(function (NovaRequest $request) use ($user) {
            return $user->hasAnyPermission(['control founders']);
        });
    }
}
