- Removed the old `connected-apps.create` implementation and components, simplifying the codebase. - Introduced modular OIDC integration using reusable components and traits, such as `WithSearchableChoices` and `WithRepeaterFields`. - Added `StoreOIDCAppForm` for handling OpenID Connect app-specific fields and validation. - Updated `choices.blade.php` and related components to leverage configuration-driven, dynamic multi-select functionality. - Updated routes to support new OIDC app creation under distinct connection protocol namespaces. - Enhanced app creation flow with support for dynamic fields like URIs (`repeater-input`) and scoped user roles.
44 lines
1.0 KiB
PHP
44 lines
1.0 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Enums;
|
|
|
|
use App\Concerns\EnumValuesAsArray;
|
|
use App\Contracts\EnumMorphsToOptionsContract;
|
|
|
|
enum UserAccessTypeEnum: string implements EnumMorphsToOptionsContract
|
|
{
|
|
use EnumValuesAsArray;
|
|
case Everyone = 'everyone';
|
|
case Role = 'role';
|
|
|
|
/**
|
|
* @return array<array{name: string, value:string, hint:string}>
|
|
*/
|
|
public static function asOptions(): array
|
|
{
|
|
return array_map(fn (self $enum) => [
|
|
'name' => $enum->toLabel(),
|
|
'value' => $enum->value,
|
|
'hint' => $enum->toHint(),
|
|
], self::cases());
|
|
}
|
|
|
|
public function toLabel(): string
|
|
{
|
|
return match ($this) {
|
|
self::Everyone => 'Everyone',
|
|
self::Role => 'Role',
|
|
};
|
|
}
|
|
|
|
public function toHint(): string
|
|
{
|
|
return match ($this) {
|
|
self::Everyone => 'Everyone can access the application.',
|
|
self::Role => 'Only users with the specified role can access the application.',
|
|
};
|
|
}
|
|
}
|