UserManagementService
class UserManagementService (View source)
Domain service for user management operations
This service encapsulates business logic related to user operations and coordinates between repositories and other domain services.
Constants
| ERR_USERNAME_REQUIRED |
|
| ERR_INVALID_LDAP |
|
| ERR_INVALID_AUTH_METHOD |
|
| ERR_ZONE_LIMIT |
|
| ERR_PASSWORD_REQUIRED |
|
| ERR_PASSWORD_POLICY |
|
| ERR_FIELD_LENGTH |
|
| ERR_USERNAME_EXISTS |
|
| ERR_EMAIL_EXISTS |
|
| ERR_INVALID_EMAIL |
|
| ERR_NO_TEMPLATE |
|
| ERR_TEMPLATE_NOT_FOUND |
|
| ERR_NOT_FOUND |
|
| ERR_PASSWORD_FORBIDDEN |
|
| ERR_LAST_ADMIN |
|
| ERR_LAST_ADMIN_DEMOTE |
|
| ERR_TRANSFER_TARGET |
|
| ERR_ZONE_DELETE_FORBIDDEN |
|
| ERR_ZONE_META_FORBIDDEN |
|
| ERR_ZONE_WRITE |
|
| ERR_WRITE |
|
Methods
No description
Get a user by ID with complete information including permissions
Get one page of users with their details and permissions, without counting them
Count all users, or those matching the search
Check if a user exists by ID
Get user details by username (similar to list format)
Get user details by email (similar to list format)
Delete a user and transfer their zones to another user
Delete a user, deciding zone by zone what happens to what they own: each decision names a zone id and a target, 'delete' or 'new_owner' (with 'newowner'); any other target leaves the zone as it is. Every decision is checked against the acting user's zone rights before any zone is touched, so a later refusal cannot leave the earlier ones half applied. That the acting user may delete this user at all is the caller's check.
Assign permission template to a user
Details
__construct(UserRepositoryInterface $userRepository, PermissionService $permissionService, UserProfileAssembler $profileAssembler, PasswordHasherInterface $authService, PasswordPolicyInterface $passwordPolicy, bool $ldapEnabled, DomainManagerInterface $domainManager, ZoneManagementService $zones, bool $remoteUserEnabled = false, ZoneOwnershipLimit|null $ownershipLimit = null, bool $protectLastAdminOnEdit = false, LoggerInterface|null $logger = null, TransactionInterface|null $transaction = null)
No description
array|null
getUserById(int $userId)
Get a user by ID with complete information including permissions
array
getUsersList(Pagination $pagination)
Get paginated list of users with their details and permissions
array
getUsersPage(Pagination $pagination, string|null $search = null, array $sort = [])
Get one page of users with their details and permissions, without counting them
int
countUsers(string|null $search = null)
Count all users, or those matching the search
bool
userExists(int $userId)
Check if a user exists by ID
array|null
getUserByUsername(string $username)
Get user details by username (similar to list format)
array|null
getUserByEmail(string $email)
Get user details by email (similar to list format)
array
createUser(CreateUserCommand $command)
Create a new user
array
updateUser(int $userId, UpdateUserCommand $command)
Update an existing user
array
deleteUser(int $userId, int|null $transferToUserId = null, int|null $actingUserId = null)
Delete a user and transfer their zones to another user
array
deleteUserWithZoneDecisions(int $actingUserId, int $userId, array $zoneDecisions)
Delete a user, deciding zone by zone what happens to what they own: each decision names a zone id and a target, 'delete' or 'new_owner' (with 'newowner'); any other target leaves the zone as it is. Every decision is checked against the acting user's zone rights before any zone is touched, so a later refusal cannot leave the earlier ones half applied. That the acting user may delete this user at all is the caller's check.
array
assignPermissionTemplate(int $userId, int $permTemplId)
Assign permission template to a user