Fixes the configuration file

This commit is contained in:
2026-03-16 14:34:07 +01:00
parent ede31b15cb
commit 29a94899da
16 changed files with 559 additions and 18 deletions

View File

@@ -0,0 +1,71 @@
<?php
declare(strict_types=1);
namespace App\Policies;
use App\Models\Config;
use App\Models\User;
final class ConfigPolicy
{
/**
* Determine whether the user can view any config records.
* Config records are auto-created by the Config Service, so all users may view the list.
*/
public function viewAny(User $user): bool
{
return true;
}
/**
* Determine whether the user can view a specific config record.
*/
public function view(User $user, Config $config): bool
{
return true;
}
/**
* Determine whether the user can update the config record.
* All users with Nova access may edit config values.
*/
public function update(User $user, Config $config): bool
{
return true;
}
/**
* Determine whether the user can create config records.
* Config records are auto-created by the Config Service manual creation is not permitted.
*/
public function create(User $user): bool
{
return false;
}
/**
* Determine whether the user can delete the config record.
* Config records are managed by the Config Service and must not be manually deleted.
*/
public function delete(User $user, Config $config): bool
{
return false;
}
/**
* Determine whether the user can restore the config record.
*/
public function restore(User $user, Config $config): bool
{
return false;
}
/**
* Determine whether the user can permanently delete the config record.
*/
public function forceDelete(User $user, Config $config): bool
{
return false;
}
}