Skip to content

Commit 76df73c

Browse files
authored
Merge pull request #54 from OpenSID/akun-bu-husnul
bypass user manajemen
2 parents df56a6d + c08af9c commit 76df73c

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

app/Filament/Resources/TicketResource/Pages/ListTickets.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ protected function getActions(): array
2525

2626
protected function getTableQuery(): Builder
2727
{
28+
// 🔥 ATASAN: BISA LIHAT SEMUA TIKET
29+
if (in_array(auth()->user()->name, ['Husnul Septia'])) {
30+
return parent::getTableQuery()->orderBy('created_at', 'desc');
31+
}
32+
2833
return parent::getTableQuery()
2934
->where(function ($query) {
3035
return $query->where('owner_id', auth()->user()->id)

app/Policies/TicketPolicy.php

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,13 @@ class TicketPolicy
1818
*/
1919
public function viewAny(User $user)
2020
{
21+
// 🔥 ATASAN: BISA LIHAT SEMUA TIKET
22+
if (in_array($user->name, [
23+
'Husnul Septia',
24+
])) {
25+
return true;
26+
}
27+
2128
return $user->can('List tickets');
2229
}
2330

@@ -30,6 +37,13 @@ public function viewAny(User $user)
3037
*/
3138
public function view(User $user, Ticket $ticket)
3239
{
40+
// 🔥 ATASAN: BISA LIHAT SEMUA TIKET
41+
if (in_array($user->name, [
42+
'Husnul Septia',
43+
])) {
44+
return true;
45+
}
46+
3347
return $user->can('View ticket')
3448
&& (
3549
$ticket->owner_id === $user->id

0 commit comments

Comments
 (0)