diff --git a/Classes/AttachPermissionsToGroups.php b/Classes/AttachPermissionsToGroups.php index aba2630..6a30649 100644 --- a/Classes/AttachPermissionsToGroups.php +++ b/Classes/AttachPermissionsToGroups.php @@ -80,6 +80,12 @@ private function expandGroupPermissionsWithPermissionSet(array $group, Permissio $group['mfa_providers'] .= ',' . implode(',', $this->expandMfaProviderInstruction($additionalMfaProviders)); } + // Attach custom options + $customOptions = $permissionSet->getCustomOptions(); + if ($customOptions) { + $group['custom_options'] .= ',' . implode(',', $this->expandCustomOptionsInstruction($customOptions)); + } + // Attach sites / pages if ($permissionSet->getAllowedSitesAndPages()) { $sitesAndPages = $permissionSet->getAllowedSitesAndPages(); @@ -241,4 +247,16 @@ private function expandMfaProviderInstruction(array $allowedMfaProviders): array return $allowedMfaProviders; } + + private function expandCustomOptionsInstruction(array $customOptions): array + { + $expandedCustomOptions = []; + foreach ($customOptions as $group => $options) { + foreach ($options as $option) { + $expandedCustomOptions[] = $group . ':' . $option; + + } + } + return $expandedCustomOptions; + } } diff --git a/Classes/PermissionSet.php b/Classes/PermissionSet.php index ddf16a6..69ee77e 100644 --- a/Classes/PermissionSet.php +++ b/Classes/PermissionSet.php @@ -106,4 +106,9 @@ public function getAllowedLanguages(): ?array { return $this->instructions['languages'] ?? null; } + + public function getCustomOptions(): ?array + { + return $this->instructions['custom_options'] ?? null; + } }