first init

This commit is contained in:
ISMAIL MASSERAN
2026-06-08 11:37:14 +08:00
commit 94ecbe5887
1058 changed files with 87732 additions and 0 deletions
+59
View File
@@ -0,0 +1,59 @@
<?php
namespace Modules\Role\Policies;
use Illuminate\Auth\Access\HandlesAuthorization;
use Modules\Role\Entities\Role;
class RolePolicy
{
use HandlesAuthorization;
/**
* Determine whether the user can view any models.
*/
public function viewAny($user): bool
{
return $user->hasPermissionTo('lihat jenis pengguna');
}
/**
* Determine whether the user can view the model.
*/
public function view($user, ?Role $role = null): bool
{
return $user->hasPermissionTo('lihat jenis pengguna');
}
/**
* Determine whether the user can create models.
*/
public function create($user): bool
{
return $user->hasPermissionTo('tambah jenis pengguna');
}
/**
* Determine whether the user can update the model.
*/
public function update($user, ?Role $role = null): bool
{
return $user->hasPermissionTo('kemaskini jenis pengguna');
}
/**
* Determine whether the user can delete any model.
*/
public function deleteAny($user): bool
{
return $user->hasPermissionTo('hapus jenis pengguna');
}
/**
* Determine whether the user can delete the model.
*/
public function delete($user, ?Role $role = null): bool
{
return $user->hasPermissionTo('hapus jenis pengguna');
}
}