72 lines
1.5 KiB
PHP
72 lines
1.5 KiB
PHP
<?php
|
|
|
|
namespace App\Policies;
|
|
|
|
use App\Models\LesenPenjaja;
|
|
use App\Models\User;
|
|
use App\Models\UserPolicies;
|
|
use Illuminate\Auth\Access\Response;
|
|
|
|
class LesenPenjajaPolicy
|
|
{
|
|
/**
|
|
* Determine whether the user can view any models.
|
|
*/
|
|
public function viewAny(User $user): bool
|
|
{
|
|
//
|
|
return UserPolicies::where('user_id', $user)->where('modul', 'penjaja')->exists();
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can view the model.
|
|
*/
|
|
public function view(User $user, LesenPenjaja $lesenPenjaja): bool
|
|
{
|
|
//
|
|
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can create models.
|
|
*/
|
|
public function create(User $user): bool
|
|
{
|
|
//
|
|
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can update the model.
|
|
*/
|
|
public function update(User $user, LesenPenjaja $lesenPenjaja): bool
|
|
{
|
|
//
|
|
return UserPolicies::where('user_id', $user)->where('modul', 'penjaja')->where('akses', 'jana wang proses')->exists();
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can delete the model.
|
|
*/
|
|
public function delete(User $user, LesenPenjaja $lesenPenjaja): bool
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can restore the model.
|
|
*/
|
|
public function restore(User $user, LesenPenjaja $lesenPenjaja): bool
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Determine whether the user can permanently delete the model.
|
|
*/
|
|
public function forceDelete(User $user, LesenPenjaja $lesenPenjaja): bool
|
|
{
|
|
//
|
|
}
|
|
}
|