GroupService
class GroupService (View source)
Creates, updates, deletes and lists user groups, with the view checks the group pages need.
Handles group CRUD operations, visibility filtering, and validation
Methods
No description
List groups with visibility filtering
Get a group by ID with visibility check
Check if a user can view a group
Create a new group
Update an existing group
Delete a group
Get group details including member and zone counts
Check if a group name is available
Details
__construct(UserGroupRepositoryInterface $groupRepository, ZoneOwnershipGuard $ownershipGuard, LastSuperAdminGuard $superAdminGuard)
No description
array
listGroups(int $userId, bool $isAdmin)
List groups with visibility filtering
UserGroup|null
getGroupById(int $groupId, int $userId, bool $isAdmin)
Get a group by ID with visibility check
bool
canUserViewGroup(int $groupId, int $userId)
Check if a user can view a group
UserGroup
createGroup(string $name, int $permTemplId, string|null $description = null, int|null $createdBy = null)
Create a new group
UserGroup|array
updateGroup(int $groupId, string|null $name = null, string|null $description = null, int|null $permTemplId = null)
Update an existing group
bool|array
deleteGroup(int $groupId)
Delete a group
Cascade deletes will remove all memberships and zone associations
array
getGroupDetails(int $groupId)
Get group details including member and zone counts
bool
isGroupNameAvailable(string $name, int|null $excludeGroupId = null)
Check if a group name is available