updates for active directory now with docs
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
namespace Modules\ActiveDirectory\Providers;
|
||||
|
||||
use App\Models\User;
|
||||
use Illuminate\Support\Facades\Gate;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Modules\ActiveDirectory\Console\Commands\SyncActiveDirectory;
|
||||
|
||||
class ActiveDirectoryServiceProvider extends ServiceProvider
|
||||
{
|
||||
public function register(): void
|
||||
{
|
||||
$this->mergeConfigFrom(__DIR__.'/../config/config.php', 'ad-sync');
|
||||
}
|
||||
|
||||
public function boot(): void
|
||||
{
|
||||
$this->loadMigrationsFrom(__DIR__.'/../database/migrations');
|
||||
Gate::define('manage-directory-sync', fn (User $user): bool => $user->ad_guid === null
|
||||
&& $user->id === config('ad-sync.admin-id'));
|
||||
|
||||
if ($this->app->runningInConsole()) {
|
||||
$this->commands([SyncActiveDirectory::class]);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user