]> git.proxmox.com Git - pve-access-control.git/commitdiff
realm: sync: allow explicit 'none' for 'remove-vanished' option
authorDominik Csapak <d.csapak@proxmox.com>
Tue, 6 Dec 2022 11:06:30 +0000 (12:06 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Wed, 14 Dec 2022 11:14:59 +0000 (12:14 +0100)
with that, the api call can now override the default option
that is set on the realm (if any) by providing 'none'

it was not possible previously to override the realm default
when one wanted no properties to delete

no other code changes are necessary since we only extract the
known values 'acl' etc. and 'none' has no meaning there

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
src/PVE/Auth/Plugin.pm

index 03d3342e48c7004ec7047e8be3bd009f232bd0ad..bae9fb9e69bcde0cfdbe2d31657414a05f0e0add 100755 (executable)
@@ -63,10 +63,12 @@ my $realm_sync_options_desc = {
            ." vanishes during a sync. The following values are possible: 'entry' removes the"
            ." user/group when not returned from the sync. 'properties' removes the set"
            ." properties on existing user/group that do not appear in the source (even custom ones)."
            ." vanishes during a sync. The following values are possible: 'entry' removes the"
            ." user/group when not returned from the sync. 'properties' removes the set"
            ." properties on existing user/group that do not appear in the source (even custom ones)."
-           ." 'acl' removes acls when the user/group is not returned from the sync.",
+           ." 'acl' removes acls when the user/group is not returned from the sync."
+           ." Instead of a list it also can be 'none' (the default).",
        type => 'string',
        type => 'string',
-       typetext => "[acl];[properties];[entry]",
-       pattern => "(?:$remove_options\;)*$remove_options",
+       default => 'none',
+       typetext => "([acl];[properties];[entry])|none",
+       pattern => "(?:(?:$remove_options\;)*$remove_options)|none",
        optional => '1',
     },
     # TODO check/rewrite in pve7to8, and remove with 8.0
        optional => '1',
     },
     # TODO check/rewrite in pve7to8, and remove with 8.0