Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions Classes/AttachPermissionsToGroups.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down Expand Up @@ -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;
}
}
5 changes: 5 additions & 0 deletions Classes/PermissionSet.php
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,9 @@ public function getAllowedLanguages(): ?array
{
return $this->instructions['languages'] ?? null;
}

public function getCustomOptions(): ?array
{
return $this->instructions['custom_options'] ?? null;
}
}