ApiPermissionService
class ApiPermissionService (View source)
Permission gate for the public API. A facade over PermissionService so the API and the web UI share one oracle; group and visible-zone lookups read the user repository.
Constants
| TEMPLATE_ASSIGN_DENIED |
|
| TEMPLATE_SELF_ASSIGN_DENIED |
|
| TEMPLATE_SUPERUSER_DENIED |
|
| TEMPLATE_NOT_SUBSET_DENIED |
|
Methods
No description
The underlying oracle, for callers that take a PermissionService.
Grant from the user's own template or any group template; ueberusers hold every permission.
Return the group IDs the user is a member of.
Direct ownership or through any group the user belongs to.
No description
Content-edit grant that applies to the zone (never own_as_client, never metadata).
No description
No description
No description
MASTER/NATIVE/SLAVE only: the API does not create catalog kinds.
No description
DNSSEC on a zone being created: the caller must end up owning it, directly or via one of the groups.
No description
No description
No description
No description
No description
No description
No description
Read the permission template currently stored on an account.
No description
No description
No description
No description
No description
Template records follow the caller's global edit level; clients may not write SOA/NS/LUA.
No description
No description
No description
No description
Change request level narrowed to the zone: "all", "own", or "none".
Change approve level narrowed to the zone: "all", "own", or "none".
How the user's zone changes are handled: written directly, filed as a change request, or refused. With change approval off this is today's edit rule.
Whether the user may approve or reject change requests for the zone.
Zones whose change requests the user may review: null for every zone, otherwise the owned zones (or none) that the approve and edit levels cover.
Whether a zone deletion has to go through a change request. Deleting stays direct for holders of the delete permission unless every change is reviewed.
Whether the user may file a request to delete the zone: their request level covers it, or every change is reviewed and they could delete it.
canEditZoneRecord()'s record-type rule for filing a request: SOA/NS/LUA need an edit grant above own_as_client or a request level that covers the zone, except subzone NS records for zone_content_edit_ns_subzone holders.
Zones the user owns directly or through any group.
Get all zone IDs that the user is allowed to view (stateless)
Details
__construct(UserLookupInterface&UserPermissionReadInterface $userRepository, PermissionService $permissions, ConfigurationInterface|null $config = null)
No description
PermissionService
permissions()
The underlying oracle, for callers that take a PermissionService.
bool
userHasPermission(int $userId, string $permissionName)
Grant from the user's own template or any group template; ueberusers hold every permission.
array
getUserGroupIds(int $userId)
Return the group IDs the user is a member of.
bool
userOwnsZone(int $userId, int $zoneId)
Direct ownership or through any group the user belongs to.
bool
canViewZone(int $userId, int $zoneId)
No description
bool
hasZoneContentEditPermission(int $userId, int $zoneId)
Content-edit grant that applies to the zone (never own_as_client, never metadata).
bool
canEditZoneContent(int $userId, int $zoneId, string|null $zoneType = null)
No description
bool
canEditZoneRecord(int $userId, int $zoneId, string $recordType, string|null $zoneType = null, string|null $recordName = null, string|null $zoneName = null)
No description
bool
canDeleteZone(int $userId, int $zoneId)
No description
bool
canCreateZone(int $userId, string $zoneType = 'MASTER')
MASTER/NATIVE/SLAVE only: the API does not create catalog kinds.
bool
canManageDnssec(int $userId, int $zoneId)
No description
bool
canManageDnssecForNewZone(int $userId, int|null $ownerId, array $groupIds = [])
DNSSEC on a zone being created: the caller must end up owning it, directly or via one of the groups.
bool
canViewUser(int $userId, int $targetUserId)
No description
bool
canEditUser(int $userId, int $targetUserId)
No description
bool
canEditUserPassword(int $userId, int $targetUserId)
No description
bool
canCreateUser(int $userId)
No description
bool
canDeleteUser(int $userId, int $targetUserId)
No description
bool
canManageGroups(int $userId)
No description
bool
canEditPermissionTemplates(int $userId)
No description
int|null
getUserPermissionTemplateId(int $userId)
Read the permission template currently stored on an account.
bool
templateGrantsSuperuser(int $permTemplId)
No description
string|null
checkPermissionTemplateAssignment(int $userId, int|null $targetUserId, int $permTemplId)
No description
bool
canListUsers(int $userId)
No description
bool
canCreateZoneTemplate(int $userId)
No description
bool
canEditZoneTemplate(int $userId)
No description
bool
canWriteTemplateRecordType(int $userId, string $recordType)
Template records follow the caller's global edit level; clients may not write SOA/NS/LUA.
bool
canViewZoneTemplates(int $userId)
No description
bool
canEditZoneMeta(int $userId, int $zoneId)
No description
bool
canViewZoneMetadata(int $userId, int $zoneId)
No description
bool
canViewZoneOwnership(int $userId, int $zoneId)
No description
string
getChangeRequestPermissionLevelForZone(int $userId, int $zoneId)
Change request level narrowed to the zone: "all", "own", or "none".
string
getChangeApprovePermissionLevelForZone(int $userId, int $zoneId)
Change approve level narrowed to the zone: "all", "own", or "none".
string
getChangeApprovalMode(int $userId, int $zoneId)
How the user's zone changes are handled: written directly, filed as a change request, or refused. With change approval off this is today's edit rule.
bool
canReviewChangeRequests(int $userId, int $zoneId)
Whether the user may approve or reject change requests for the zone.
array|null
getReviewableZoneIds(int $userId)
Zones whose change requests the user may review: null for every zone, otherwise the owned zones (or none) that the approve and edit levels cover.
bool
zoneDeleteRequiresApproval(int $userId, int $zoneId)
Whether a zone deletion has to go through a change request. Deleting stays direct for holders of the delete permission unless every change is reviewed.
bool
canRequestZoneDelete(int $userId, int $zoneId)
Whether the user may file a request to delete the zone: their request level covers it, or every change is reviewed and they could delete it.
bool
canRequestZoneRecord(int $userId, int $zoneId, string $recordType, string|null $recordName = null, string|null $zoneName = null)
canEditZoneRecord()'s record-type rule for filing a request: SOA/NS/LUA need an edit grant above own_as_client or a request level that covers the zone, except subzone NS records for zone_content_edit_ns_subzone holders.
array
getUserOwnedZoneIds(int $userId)
Zones the user owns directly or through any group.
array|null
getUserVisibleZoneIds(int $userId)
Get all zone IDs that the user is allowed to view (stateless)