Skip to content

Commit

Permalink
fix: docs access
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiio committed Mar 7, 2024
1 parent cac9ac3 commit 9c1d19f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 6 additions & 0 deletions app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,13 @@
namespace App\Providers;

use App\Filament\Pages\Auth\Settings;
use App\Models\User;
use Carbon\Carbon;
use Filament\Facades\Filament;
use Filament\Navigation\UserMenuItem;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\File;
use Illuminate\Support\Facades\Gate;
use Illuminate\Support\ServiceProvider;

class AppServiceProvider extends ServiceProvider
Expand Down Expand Up @@ -52,6 +54,10 @@ public function boot()
->icon('heroicon-o-cog'),
]);
});

Gate::define('viewApiDocs', function (User $user) {
return $user->canAccessFilament() && $user->isPlatformAdmin();
});
}

public function registerReleaseVersion(): void
Expand Down
1 change: 0 additions & 1 deletion routes/api.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
| is assigned the "api" middleware group. Enjoy building your API!
|
*/
Gate::define('viewApiDocs', fn () => true);

Route::middleware('auth:sanctum')
->prefix('/v1')
Expand Down

0 comments on commit 9c1d19f

Please sign in to comment.