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_PASSWORD_REQUIRED |
|
| ERR_PASSWORD_POLICY |
|
| ERR_FIELD_LENGTH |
|
| ERR_USERNAME_EXISTS |
|
| ERR_EMAIL_EXISTS |
|
| ERR_NO_TEMPLATE |
|
| ERR_TEMPLATE_NOT_FOUND |
|
| ERR_NOT_FOUND |
|
| ERR_PASSWORD_FORBIDDEN |
|
| ERR_LAST_ADMIN |
|
| 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
Check if a user exists by ID
Check if a user exists by username
Check if a user exists by email
Get user details by username (similar to list format)
Get user details by email (similar to list format)
Get basic user information for verification purposes
Create a new user
Update an existing user
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
Only the empty string means "leave unchanged"; "0" is a password.
Details
__construct(UserRepository $userRepository, PermissionService $permissionService, UserGroupRepositoryInterface $groupRepository, UserAuthenticationService $authService, PasswordPolicyService $passwordPolicy, bool $ldapEnabled, DomainManagerInterface $domainManager)
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
bool
userExists(int $userId)
Check if a user exists by ID
bool
userExistsByUsername(string $username)
Check if a user exists by username
bool
userExistsByEmail(string $email)
Check if a user exists by email
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|null
getUserForVerification(int $userId)
Get basic user information for verification purposes
array
createUser(array $userData)
Create a new user
array
updateUser(int $userId, array $userData)
Update an existing user
array
deleteUser(int $userId, int|null $transferToUserId = 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
static bool
passwordGiven(array $userData)
Only the empty string means "leave unchanged"; "0" is a password.