- Added authorization checks in Livewire components related to Docker and server management to ensure only authorized users can create, update, and manage Docker instances and server settings. - Introduced new policies for StandaloneDocker and SwarmDocker to define access control rules based on user roles and team associations. - Updated AuthServiceProvider to register the new policies, enhancing security and access control for Docker functionalities and server management operations.
30 lines
833 B
PHP
30 lines
833 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
// use Illuminate\Support\Facades\Gate;
|
|
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
|
|
|
|
class AuthServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* The model to policy mappings for the application.
|
|
*
|
|
* @var array<class-string, class-string>
|
|
*/
|
|
protected $policies = [
|
|
\App\Models\Server::class => \App\Policies\ServerPolicy::class,
|
|
\App\Models\PrivateKey::class => \App\Policies\PrivateKeyPolicy::class,
|
|
\App\Models\StandaloneDocker::class => \App\Policies\StandaloneDockerPolicy::class,
|
|
\App\Models\SwarmDocker::class => \App\Policies\SwarmDockerPolicy::class,
|
|
];
|
|
|
|
/**
|
|
* Register any authentication / authorization services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|