%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /www/loslex/test/app/Policies/
Upload File :
Create Path :
Current File : /www/loslex/test/app/Policies/UserPolicy.php

<?php

namespace App\Policies;

use App\Models\User;
use Illuminate\Auth\Access\Response;

class UserPolicy
{
    public function before(User $user, string $ability): bool|null
    {
        if ($user->is_admin) return true;
        return null;
    }

    /* Determine whether the user can view any models. */
    public function viewAny(User $user): bool
    {
        // only Admin can list all users
        return false;
    }

    /* Determine whether the user can view the model. */
    public function show(User $user, User $model): bool
    {
        // Organizer can display user details
        return $user->organizer_groups->count() > 0;
    }

    /* Determine whether the user can update the model. */
    public function edit(User $user, User $model): bool
    {
        return false;
    }

    /* Determine whether the user can merge the model into another model */
    public function merge(User $user, User $model): bool
    {
        return false;
    }

    /* Determine whether the user can delete the model. */
    public function delete(User $user, User $model): bool
    {
        return false;
    }

    /* Determine whether the user can restore the model. */
    public function restore(User $user, User $model): bool
    {
        return false;
    }

    /* Determine whether the user can permanently delete the model. */
    public function forceDelete(User $user, User $model): bool
    {
        return false;
    }
}

Zerion Mini Shell 1.0