Skip to content

Commit 2a278bf

Browse files
Update PulsaKegiatan policies to include 'pbj' role for access permissions
1 parent 6309381 commit 2a278bf

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

app/Nova/PulsaKegiatan.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ public function subtitle()
6363
public static function indexQuery(NovaRequest $request, $query)
6464
{
6565
$query->where('tahun', session('year'));
66-
if (Policy::make()->allowedFor('ppk,arsiparis,bendahara,kpa,ppspm')->get()) {
66+
if (Policy::make()->allowedFor('ppk,arsiparis,bendahara,kpa,ppspm,pbj')->get()) {
6767
return $query;
6868
} elseif (Policy::make()->allowedFor('koordinator,anggota')->get()) {
6969
return $query->where('unit_kerja_id', Helper::getDataPegawaiByUserId($request->user()->id, now())->unit_kerja_id);

app/Policies/PulsaKegiatanPolicy.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public function viewAny(): bool
2525
public function view(User $user, PulsaKegiatan $pulsa): bool
2626
{
2727
return Policy::make()
28-
->allowedFor('ppk,arsiparis,bendahara,kpa,ppspm,koordinator,anggota')
28+
->allowedFor('ppk,arsiparis,bendahara,kpa,ppspm,koordinator,anggota,pbj')
2929
->withYear($pulsa->tahun)
3030
->get();
3131
}
@@ -79,6 +79,10 @@ public function replicate(): bool
7979
*/
8080
public function runAction(User $user, PulsaKegiatan $pulsa): bool
8181
{
82+
if (Policy::make()->allowedFor('ppk,pbj,bendahara,ppspm,arsiparis')->get()) {
83+
return true;
84+
}
85+
8286
return Policy::make()
8387
->allowedFor('koordinator,anggota')
8488
->withYear($pulsa->tahun)

0 commit comments

Comments
 (0)