Update AuthServiceProvider

This commit is contained in:
Daniel Supernault 2019-09-13 19:55:24 -06:00
parent 64e4c002e9
commit e359b6b98a
No known key found for this signature in database
GPG Key ID: 0DEF1C662C9033F7
1 changed files with 11 additions and 4 deletions

View File

@ -4,6 +4,7 @@ namespace App\Providers;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
use Laravel\Passport\Passport; use Laravel\Passport\Passport;
use Gate;
class AuthServiceProvider extends ServiceProvider class AuthServiceProvider extends ServiceProvider
{ {
@ -32,14 +33,20 @@ class AuthServiceProvider extends ServiceProvider
Passport::enableImplicitGrant(); Passport::enableImplicitGrant();
Passport::setDefaultScope([ Passport::setDefaultScope([
'user:read', 'read',
'user:write' 'write',
'follow'
]); ]);
Passport::tokensCan([ Passport::tokensCan([
'user:read' => 'Read a users profile info and media', 'read' => 'Full read access to your account',
'user:write' => 'This scope lets an app "Change your profile information"', 'write' => 'Full write access to your account',
'follow' => 'Ability to follow other profiles'
]); ]);
} }
Gate::define('viewWebSocketsDashboard', function ($user = null) {
return $user->is_admin;
});
} }
} }