sistem-akademik/app/Policies/ExtracurricularPolicy.php
2025-05-01 19:51:32 +07:00

66 lines
1.5 KiB
PHP

<?php
namespace App\Policies;
use App\Models\Extracurricular;
use App\Models\User;
class ExtracurricularPolicy
{
/**
* Determine whether the user can view any models.
*/
public function viewAny(User $user): bool
{
return $user->can('view_any_extracurricular');
}
/**
* Determine whether the user can view the model.
*/
public function view(User $user, Extracurricular $extracurricular): bool
{
return $user->can('view_extracurricular');
}
/**
* Determine whether the user can create models.
*/
public function create(User $user): bool
{
return $user->can('create_extracurricular');
}
/**
* Determine whether the user can update the model.
*/
public function update(User $user, Extracurricular $extracurricular): bool
{
return $user->can('update_extracurricular');
}
/**
* Determine whether the user can delete the model.
*/
public function delete(User $user, Extracurricular $extracurricular): bool
{
return $user->can('delete_extracurricular');
}
/**
* Determine whether the user can restore the model.
*/
public function restore(User $user, Extracurricular $extracurricular): bool
{
return $user->can('restore_extracurricular');
}
/**
* Determine whether the user can permanently delete the model.
*/
public function forceDelete(User $user, Extracurricular $extracurricular): bool
{
return $user->can('force_delete_extracurricular');
}
}