Skip to content

Commit

Permalink
Show punishments in admin sidebar if its not public
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinecraft committed Nov 8, 2024
1 parent e264bc6 commit 93c6359
Show file tree
Hide file tree
Showing 190 changed files with 1,797 additions and 1,786 deletions.
2 changes: 2 additions & 0 deletions app/Http/Middleware/HandleInertiaRequests.php
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ public function share(Request $request)
'playerSkinChangerEnabled' => config('minetrax.player_skin_changer_enabled'),
'localeSwitcherEnabled' => count(config('app.available_locales')) > 0,
'banwarden' => [
'enabled' => config('minetrax.banwarden.enabled'),
'showPublic' => config('minetrax.banwarden.show_public'),
'canShowMaskedIp' => config('minetrax.banwarden.show_masked_ip_public') ? true : $request->user()?->isStaffMember(),
],
]);
Expand Down
4 changes: 2 additions & 2 deletions app/Policies/PlayerPunishmentPolicy.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ public function viewAny(?User $user): bool
return true;
}

if ($user->can('read banwarden_punishments')) {
if ($user?->can('read banwarden_punishments')) {
return true;
}

Expand All @@ -45,7 +45,7 @@ public function view(?User $user, PlayerPunishment $playerPunishment): bool
return true;
}

if ($user->can('read banwarden_punishments')) {
if ($user?->can('read banwarden_punishments')) {
return true;
}

Expand Down
2 changes: 1 addition & 1 deletion app/View/Components/PhpVarsToJsTransformer.php
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ private function generateCustomNavbarData($navbarSettings)

$leftNavbar = self::DEFAULT_NAV_LEFT;
// Add BanWarden to navbar if enabled
if (config('minetrax.banwarden.enabled')) {
if (config('minetrax.banwarden.enabled') && config('minetrax.banwarden.show_public')) {
$leftNavbar[] = [
'type' => 'route',
'name' => 'Punishments',
Expand Down

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions public/build/default/assets/AdminLayout-43c7bab8.js

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion public/build/default/assets/AdminLayout-f3b248dc.js

This file was deleted.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 93c6359

Please sign in to comment.