mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 00:03:16 +00:00
Update AuthServiceProvider
This commit is contained in:
parent
64e4c002e9
commit
e359b6b98a
1 changed files with 11 additions and 4 deletions
|
@ -4,6 +4,7 @@ namespace App\Providers;
|
|||
|
||||
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
||||
use Laravel\Passport\Passport;
|
||||
use Gate;
|
||||
|
||||
class AuthServiceProvider extends ServiceProvider
|
||||
{
|
||||
|
@ -32,14 +33,20 @@ class AuthServiceProvider extends ServiceProvider
|
|||
Passport::enableImplicitGrant();
|
||||
|
||||
Passport::setDefaultScope([
|
||||
'user:read',
|
||||
'user:write'
|
||||
'read',
|
||||
'write',
|
||||
'follow'
|
||||
]);
|
||||
|
||||
Passport::tokensCan([
|
||||
'user:read' => 'Read a user’s profile info and media',
|
||||
'user:write' => 'This scope lets an app "Change your profile information"',
|
||||
'read' => 'Full read access to your account',
|
||||
'write' => 'Full write access to your account',
|
||||
'follow' => 'Ability to follow other profiles'
|
||||
]);
|
||||
}
|
||||
|
||||
Gate::define('viewWebSocketsDashboard', function ($user = null) {
|
||||
return $user->is_admin;
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue