@@ -4,9 +4,11 @@ namespace App\Providers;
|
||||
|
||||
use App\Http\Responses\RegisterResponse;
|
||||
use App\Models\Organization;
|
||||
use App\Models\User;
|
||||
use Carbon\CarbonImmutable;
|
||||
use Illuminate\Support\Facades\Date;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Validation\Rules\Password;
|
||||
use Laravel\Cashier\Cashier;
|
||||
@@ -41,6 +43,17 @@ class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
$this->configureDefaults();
|
||||
$this->configureCashier();
|
||||
$this->defineGates();
|
||||
}
|
||||
|
||||
/**
|
||||
* Define the site-wide administrator ability. This is deliberately separate
|
||||
* from an organization's Owner/Admin roles, which only ever grant rights
|
||||
* inside a single workspace.
|
||||
*/
|
||||
protected function defineGates(): void
|
||||
{
|
||||
Gate::define('accessAdmin', fn (User $user): bool => $user->isSiteAdmin());
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user