Skip to content

Commit 756bea9

Browse files
committed
2 parents 975b3fe + c9d3896 commit 756bea9

38 files changed

+95
-231
lines changed

app/Nova/HonorKegiatan.php

Lines changed: 28 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -391,34 +391,20 @@ public function lenses(NovaRequest $request)
391391
public function actions(NovaRequest $request)
392392
{
393393
$actions = [];
394-
if (Policy::make()->allowedFor('all')->get()) {
395-
$actions[] =
396-
Download::make('spj', 'Unduh SPJ')
397-
->showInline()
398-
->showOnDetail()
399-
->exceptOnIndex()
400-
->confirmButtonText('Unduh');
401-
$actions[] =
402-
ExportTemplateBos::make()
403-
->showInline()
404-
->showOnDetail()
405-
->exceptOnIndex()
406-
->confirmButtonText('Export');
407-
$actions[] =
408-
Download::make('st', 'Unduh Surat Tugas')
409-
->showInline()
410-
->showOnDetail()
411-
->exceptOnIndex()
412-
->confirmButtonText('Unduh')
413-
->canSee(function ($request) {
414-
if ($request instanceof ActionRequest) {
415-
return true;
416-
}
417-
418-
return $this->resource instanceof Model && $this->resource->st_naskah_keluar_id !== null;
419-
});
420-
$actions[] =
421-
Download::make('sk', 'Unduh SK')
394+
$actions[] =
395+
Download::make('spj', 'Unduh SPJ')
396+
->showInline()
397+
->showOnDetail()
398+
->exceptOnIndex()
399+
->confirmButtonText('Unduh');
400+
$actions[] =
401+
ExportTemplateBos::make()
402+
->showInline()
403+
->showOnDetail()
404+
->exceptOnIndex()
405+
->confirmButtonText('Export');
406+
$actions[] =
407+
Download::make('st', 'Unduh Surat Tugas')
422408
->showInline()
423409
->showOnDetail()
424410
->exceptOnIndex()
@@ -428,9 +414,21 @@ public function actions(NovaRequest $request)
428414
return true;
429415
}
430416

431-
return $this->resource instanceof Model && $this->resource->sk_naskah_keluar_id !== null;
417+
return $this->resource instanceof Model && $this->resource->st_naskah_keluar_id !== null;
432418
});
433-
}
419+
$actions[] =
420+
Download::make('sk', 'Unduh SK')
421+
->showInline()
422+
->showOnDetail()
423+
->exceptOnIndex()
424+
->confirmButtonText('Unduh')
425+
->canSee(function ($request) {
426+
if ($request instanceof ActionRequest) {
427+
return true;
428+
}
429+
430+
return $this->resource instanceof Model && $this->resource->sk_naskah_keluar_id !== null;
431+
});
434432
if (Policy::make()->allowedFor('bendahara')->get()) {
435433
$actions[] =
436434
ExportTemplateCmsBri::make($this->kegiatan, 'ft')

app/Nova/KerangkaAcuan.php

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,12 @@ public function lenses(NovaRequest $request)
197197
public function actions(NovaRequest $request)
198198
{
199199
$actions = [];
200-
if (Policy::make()->allowedFor('all')->get()) {
201-
$actions[] =
202-
Download::make('kak', 'Unduh KAK')
203-
->showInline()
204-
->showOnDetail()
205-
->confirmButtonText('Unduh')
206-
->exceptOnIndex();
207-
}
200+
$actions[] =
201+
Download::make('kak', 'Unduh KAK')
202+
->showInline()
203+
->showOnDetail()
204+
->confirmButtonText('Unduh')
205+
->exceptOnIndex();
208206
if (Policy::make()->allowedFor('koordinator,anggota')->get()) {
209207
$actions[] =
210208
AddPerjalananDinas::make()

app/Policies/AnalisisSakipPolicy.php

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ class AnalisisSakipPolicy
1313
*/
1414
public function viewAny(): bool
1515
{
16-
return Policy::make()
17-
->allowedFor('all')
18-
->get();
16+
return true;
1917
}
2018

2119
/**
@@ -34,9 +32,7 @@ public function view(User $user, AnalisisSakip $analisis): bool
3432
*/
3533
public function create(): bool
3634
{
37-
return Policy::make()
38-
->allowedFor('all')
39-
->get();
35+
return true;
4036
}
4137

4238
/**

app/Policies/AnggaranKerangkaAcuanPolicy.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,7 @@ public function viewAny(): bool
2222
*/
2323
public function view(): bool
2424
{
25-
return Policy::make()
26-
->allowedFor('all')
27-
->get();
25+
return true;
2826
}
2927

3028
/**

app/Policies/DaftarHonorMitraPolicy.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@ class DaftarHonorMitraPolicy
1313
*/
1414
public function viewAny(): bool
1515
{
16-
return Policy::make()
17-
->allowedFor('all')
18-
->get();
16+
return true;
1917
}
2018

2119
/**

app/Policies/DaftarHonorPegawaiPolicy.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ class DaftarHonorPegawaiPolicy
1111
*/
1212
public function viewAny(): bool
1313
{
14-
return Policy::make()
15-
->allowedFor('all')
16-
->get();
14+
return true;
1715
}
1816

1917
/**

app/Policies/DaftarKegiatanPolicy.php

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,29 +13,23 @@ class DaftarKegiatanPolicy
1313
*/
1414
public function viewAny(): bool
1515
{
16-
return Policy::make()
17-
->allowedFor('all')
18-
->get();
16+
return true;
1917
}
2018

2119
/**
2220
* Determine whether the user can view the model.
2321
*/
2422
public function view(): bool
2523
{
26-
return Policy::make()
27-
->allowedFor('all')
28-
->get();
24+
return true;
2925
}
3026

3127
/**
3228
* Determine whether the user can create models.
3329
*/
3430
public function create(): bool
3531
{
36-
return Policy::make()
37-
->allowedFor('all')
38-
->get();
32+
return true;
3933
}
4034

4135
/**

app/Policies/DaftarKontrakMitraPolicy.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ class DaftarKontrakMitraPolicy
1111
*/
1212
public function viewAny(): bool
1313
{
14-
return Policy::make()
15-
->allowedFor('all')
16-
->get();
14+
return true;
1715
}
1816

1917
/**

app/Policies/DaftarPenilaianRewardPolicy.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ public function viewAny(): bool
3232
*/
3333
public function view(): bool
3434
{
35-
return Policy::make()
36-
->allowedFor('all')
37-
->get();
35+
return true;
3836
}
3937

4038
/**

app/Policies/DaftarReminderPolicy.php

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,28 +2,22 @@
22

33
namespace App\Policies;
44

5-
use App\Helpers\Policy;
6-
75
class DaftarReminderPolicy
86
{
97
/**
108
* Determine whether the user can view any models.
119
*/
1210
public function viewAny(): bool
1311
{
14-
return Policy::make()
15-
->allowedFor('all')
16-
->get();
12+
return true;
1713
}
1814

1915
/**
2016
* Determine whether the user can view the model.
2117
*/
2218
public function view(): bool
2319
{
24-
return Policy::make()
25-
->allowedFor('all')
26-
->get();
20+
return true;
2721
}
2822

2923
/**
@@ -60,8 +54,6 @@ public function replicate(): bool
6054

6155
public function runAction(): bool
6256
{
63-
return Policy::make()
64-
->allowedFor('all')
65-
->get();
57+
return true;
6658
}
6759
}

0 commit comments

Comments
 (0)