diff --git a/src/CoreExtension/Provider/RoleOptionsProvider.php b/src/CoreExtension/Provider/RoleOptionsProvider.php index 197c3e8..d619750 100644 --- a/src/CoreExtension/Provider/RoleOptionsProvider.php +++ b/src/CoreExtension/Provider/RoleOptionsProvider.php @@ -19,7 +19,7 @@ public function __construct(array $systemRoles) public function getOptions(array $context, Data $fieldDefinition): array { - $roles = [$this->getDefaultValue()]; + $roles = [$this->getDefaultValue($context, $fieldDefinition)]; foreach ($this->originalRoles as $originalRole => $inheritedRoles) { array_push($roles, $originalRole, ...$inheritedRoles); @@ -36,7 +36,7 @@ public function hasStaticOptions(array $context, Data $fieldDefinition): bool return false; } - public function getDefaultValue(): string + public function getDefaultValue(array $context, Data $fieldDefinition): ?string { return 'ROLE_USER'; }