mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +00:00
This commit is contained in:
parent
21e59d775a
commit
f60ae41bf6
26 changed files with 741 additions and 70 deletions
|
|
@ -4,6 +4,7 @@ namespace App\Providers;
|
|||
|
||||
use App\Models\PersonalAccessToken;
|
||||
use Illuminate\Support\Facades\Event;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Laravel\Sanctum\Sanctum;
|
||||
use SocialiteProviders\Authentik\Provider as AuthentikProvider;
|
||||
|
|
@ -24,6 +25,12 @@ class AppServiceProvider extends ServiceProvider
|
|||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
// Setup admin role access
|
||||
Gate::before(function ($user, $ability)
|
||||
{
|
||||
return $user->hasRole('admin') ? true : null;
|
||||
});
|
||||
|
||||
Sanctum::usePersonalAccessTokenModel(PersonalAccessToken::class);
|
||||
|
||||
// Authentik
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue