ZoneOwnershipFormResolver
class ZoneOwnershipFormResolver (View source)
Reads the owner and group fields of the add-zone forms and applies the shared ownership rules. The forms drop what the ownership mode disallows instead of rejecting it, and word the refusals in the user's language.
Also decides which users the owner pickers offer.
Methods
No description
The users an owner picker may offer: everyone with user_view_others, otherwise only the caller.
The users a new zone may be given to: everyone when the create path lets the caller assign other owners and they may see other users, otherwise only the caller.
Whether the caller may store this autoprimary account. PowerDNS copies it into the zones it creates, so it names their owner: a caller who cannot see other users may only pick from the accounts the form offered, or keep the stored one.
The page-level refusal for a user who could not pick any owner, or null.
No description
Details
__construct(ZoneOwnershipModeService $mode, ZoneCreateOwnershipResolver $resolver, PermissionService $permissions)
No description
array
selectableOwners(array $users, int $callerUserId)
The users an owner picker may offer: everyone with user_view_others, otherwise only the caller.
array
assignableOwners(array $users, int $callerUserId)
The users a new zone may be given to: everyone when the create path lets the caller assign other owners and they may see other users, otherwise only the caller.
bool
mayNameAccount(array $users, int $callerUserId, string $account, string|null $storedAccount = null)
Whether the caller may store this autoprimary account. PowerDNS copies it into the zones it creates, so it names their owner: a caller who cannot see other users may only pick from the accounts the form offered, or keep the stored one.
string|null
blocker(int $callerUserId)
The page-level refusal for a user who could not pick any owner, or null.
ZoneOwnershipResolution
resolve(Request $request, int $callerUserId)
No description
ZoneOwnershipResolution
resolveInputs(mixed $ownerInput, mixed $groupsInput, int $callerUserId)
No description