mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-26 08:13: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 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 user’s 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;
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue