Package org.graylog2.users
Class UserServiceImpl
java.lang.Object
org.graylog2.database.PersistedServiceImpl
org.graylog2.users.UserServiceImpl
- All Implemented Interfaces:
PersistedService,UserService
- Direct Known Subclasses:
UserManagementServiceImpl
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.graylog2.database.PersistedServiceImpl
mongoConnection -
Constructor Summary
ConstructorsConstructorDescriptionUserServiceImpl(MongoConnection mongoConnection, Configuration configuration, RoleService roleService, AccessTokenService accessTokenService, UserImpl.Factory userFactory, InMemoryRolePermissionResolver inMemoryRolePermissionResolver, com.google.common.eventbus.EventBus serverEventBus, GRNRegistry grnRegistry, PermissionAndRoleResolver permissionAndRoleResolver) -
Method Summary
Modifier and TypeMethodDescriptionlongcount()create()intintdeleteById(String userId) voidDeprecated.getGRNPermissionsForUser(User user) List<org.apache.shiro.authz.Permission>getPermissionsForUser(User user) getRoleNames(User user) Get the root user.List<org.apache.shiro.authz.permission.WildcardPermission>loadAll()loadAllByName(String username) loadAllForAuthServiceBackend(String authServiceBackendId) loadAllForRole(Role role) loadByAuthServiceUidOrUsername(String authServiceUid, String username) Tries to find a user for the given authentication service UID or username.loadByIds(Collection<String> ids) save(T model) Methods inherited from class org.graylog2.database.PersistedServiceImpl
collection, collection, count, count, cursorToList, destroy, destroy, destroyAll, destroyAll, destroyAll, embed, fieldTransformations, findOne, findOne, findOne, findOne, get, get, get, query, query, query, query, query, removeEmbedded, removeEmbedded, saveWithoutValidation, totalCount, totalCount, validate, validate, validateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.graylog2.plugin.database.PersistedService
destroy, destroyAll, saveWithoutValidation, validate, validate, validate
-
Constructor Details
-
UserServiceImpl
@Inject public UserServiceImpl(MongoConnection mongoConnection, Configuration configuration, RoleService roleService, AccessTokenService accessTokenService, UserImpl.Factory userFactory, InMemoryRolePermissionResolver inMemoryRolePermissionResolver, com.google.common.eventbus.EventBus serverEventBus, GRNRegistry grnRegistry, PermissionAndRoleResolver permissionAndRoleResolver)
-
-
Method Details
-
loadById
- Specified by:
loadByIdin interfaceUserService
-
loadByIds
- Specified by:
loadByIdsin interfaceUserService
-
load
- Specified by:
loadin interfaceUserService
-
loadAllByName
- Specified by:
loadAllByNamein interfaceUserService
-
loadByAuthServiceUidOrUsername
Description copied from interface:UserServiceTries to find a user for the given authentication service UID or username. (in that order)- Specified by:
loadByAuthServiceUidOrUsernamein interfaceUserService- Parameters:
authServiceUid- the authentication service UID (tried first)username- the username (tried second)- Returns:
- the user or an empty option if no user can be found
-
delete
- Specified by:
deletein interfaceUserService
-
deleteById
- Specified by:
deleteByIdin interfaceUserService
-
create
- Specified by:
createin interfaceUserService
-
initialUserFields
-
loadAll
- Specified by:
loadAllin interfaceUserService
-
save
- Specified by:
savein interfacePersistedService- Overrides:
savein classPersistedServiceImpl- Throws:
ValidationException
-
getAdminUser
Deprecated.- Specified by:
getAdminUserin interfaceUserService
-
getRootUser
Description copied from interface:UserServiceGet the root user. The root user might not be present in all environments and there shouldn't really be a need to explicitly refer to the root user. But if you really need it, here you go.- Specified by:
getRootUserin interfaceUserService- Returns:
- The root user, if present. An empty optional otherwise.
-
count
public long count()- Specified by:
countin interfaceUserService
-
loadAllForAuthServiceBackend
- Specified by:
loadAllForAuthServiceBackendin interfaceUserService
-
getRoleNames
- Specified by:
getRoleNamesin interfaceUserService
-
getPermissionsForUser
- Specified by:
getPermissionsForUserin interfaceUserService
-
getWildcardPermissionsForUser
public List<org.apache.shiro.authz.permission.WildcardPermission> getWildcardPermissionsForUser(User user) - Specified by:
getWildcardPermissionsForUserin interfaceUserService
-
getGRNPermissionsForUser
- Specified by:
getGRNPermissionsForUserin interfaceUserService
-
getUserPermissionsFromRoles
- Specified by:
getUserPermissionsFromRolesin interfaceUserService
-