horizon gate
This commit is contained in:
parent
db079c0c7d
commit
925af53d3d
1 changed files with 12 additions and 0 deletions
|
|
@ -4,8 +4,10 @@
|
||||||
|
|
||||||
use App\Contracts\CustomJobRepositoryInterface;
|
use App\Contracts\CustomJobRepositoryInterface;
|
||||||
use App\Models\ApplicationDeploymentQueue;
|
use App\Models\ApplicationDeploymentQueue;
|
||||||
|
use App\Models\User;
|
||||||
use App\Repositories\CustomJobRepository;
|
use App\Repositories\CustomJobRepository;
|
||||||
use Illuminate\Support\Facades\Event;
|
use Illuminate\Support\Facades\Event;
|
||||||
|
use Illuminate\Support\Facades\Gate;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
use Laravel\Horizon\Contracts\JobRepository;
|
use Laravel\Horizon\Contracts\JobRepository;
|
||||||
use Laravel\Horizon\Events\JobReserved;
|
use Laravel\Horizon\Events\JobReserved;
|
||||||
|
|
@ -42,6 +44,16 @@ public function boot(): void
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
protected function gate(): void
|
||||||
|
{
|
||||||
|
Gate::define('viewHorizon', function ($user) {
|
||||||
|
$root_user = User::find(0);
|
||||||
|
|
||||||
|
return in_array($user->email, [
|
||||||
|
$root_user->email,
|
||||||
|
]);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue