
- Added authorization checks in the Create and Show Livewire components to ensure only authorized users can create, update, and delete PrivateKey instances. - Introduced a new PrivateKeyPolicy to define access control rules for viewing, creating, updating, and deleting PrivateKey models based on user roles and team associations. - Updated AuthServiceProvider to register the new PrivateKeyPolicy, enhancing security and access control for PrivateKey functionalities.
28 lines
659 B
PHP
28 lines
659 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,
|
|
];
|
|
|
|
/**
|
|
* Register any authentication / authorization services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
//
|
|
}
|
|
}
|