Interface UserReadService

All Known Implementing Classes:
UserReadServiceImpl

public interface UserReadService
Read-only retrieval service for User / UserGroup / GroupAuthority.

Phase 3 of the UserService decomposition (strangler fig). This service houses the DAO-bound read cluster previously implemented directly on UserServiceImpl: load, loadAll, findByUserName, findByEmail, findGroupByName, groupExists, findGroupsForUser, listAvailableGroups, and loadGroupAuthorities. All methods delegate directly to UserDao / UserGroupDao and orchestrate no other collaborators.

Write-side methods (create, update, delete, addUserToGroup, removeUserFromGroup, addGroupAuthority, removeGroupAuthority) stay on the UserService facade.

Authentication-flow note: UserService is NOT a Spring Security UserDetailsService — that role is played by UserManagerImpl, which depends on UserService (the facade) for both reads and writes. The facade delegates reads to this service internally, so the login path (UserManagerImpl.loadUserByUsernameuserService.findByUserName + userService.loadGroupAuthorities) continues to work unchanged. Callers should generally keep using UserService as the facade — the facade delegates to this service. Direct injection of UserReadService is appropriate where a class is logically read-only (e.g. REST endpoints that only resolve user IDs).

ACL / @Secured / @PostAuthorize annotations live on UserService / BaseUserService (the caller-facing facade interfaces); enforcement happens at the facade proxy boundary, so this interface is intentionally unsecured at the AOP boundary. The facade declares @Secured("GROUP_USER") + @PostAuthorize on findByEmail and findGroupByName, @Secured("GROUP_ADMIN") on loadAll, and AFTER_ACL_COLLECTION_READ on findGroupsForUser / listAvailableGroups — those checks still fire when the facade is the call site; intra-gemma-core callers that inject this service directly bypass the duplicate ACL check and so MUST be reads that don't need permission filtering, OR must be on the login path where unsecured reads are required by design (findByUserName, loadGroupAuthorities).

Author:
paul
See Also: