Class DefaultUserOperation
java.lang.Object
com.arangodb.springframework.core.template.DefaultUserOperation
- All Implemented Interfaces:
UserOperations
- Author:
- Mark Vollmary
-
Nested Class Summary
Nested Classes -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DefaultUserOperation
(com.arangodb.ArangoDatabase db, String username, PersistenceExceptionTranslator exceptionTranslator, DefaultUserOperation.CollectionCallback collectionCallback) -
Method Summary
Modifier and TypeMethodDescriptioncom.arangodb.entity.UserEntity
Create a new user.void
delete()
Removes an existing user, identified by user.com.arangodb.entity.UserEntity
get()
Fetches data about the specified user.com.arangodb.entity.Permissions
getCollectionPermissions
(Class<?> type) Get the collection access levelcom.arangodb.entity.Permissions
Get the collection access levelcom.arangodb.entity.Permissions
Get specific database access levelvoid
grantCollectionAccess
(Class<?> type, com.arangodb.entity.Permissions permissions) Grants or revoke access to the collection for user.void
grantCollectionAccess
(String name, com.arangodb.entity.Permissions permissions) Grants or revoke access to the collection for user.void
grantDatabaseAccess
(com.arangodb.entity.Permissions permissions) Grants or revoke access to the database for the user.void
grantDefaultCollectionAccess
(com.arangodb.entity.Permissions permissions) Sets the default access level for collections for the user.void
grantDefaultDatabaseAccess
(com.arangodb.entity.Permissions permissions) Sets the default access level for databases for the user.com.arangodb.entity.UserEntity
replace
(com.arangodb.model.UserUpdateOptions options) Replaces the data of an existing user.void
resetCollectionAccess
(Class<?> type) Clear the collection access level, revert back to the default access level.void
resetCollectionAccess
(String name) Clear the collection access level, revert back to the default access level.void
Clear the database access level, revert back to the default access level.com.arangodb.entity.UserEntity
update
(com.arangodb.model.UserUpdateOptions options) Partially updates the data of an existing user.
-
Constructor Details
-
DefaultUserOperation
protected DefaultUserOperation(com.arangodb.ArangoDatabase db, String username, PersistenceExceptionTranslator exceptionTranslator, DefaultUserOperation.CollectionCallback collectionCallback)
-
-
Method Details
-
get
Description copied from interface:UserOperations
Fetches data about the specified user. You can fetch information about yourself or you need permission to the _system database in order to execute this call.- Specified by:
get
in interfaceUserOperations
- Returns:
- information about the user
- Throws:
DataAccessException
-
create
public com.arangodb.entity.UserEntity create(String passwd, com.arangodb.model.UserCreateOptions options) throws DataAccessException Description copied from interface:UserOperations
Create a new user. This user will not have access to any database. You need permission to the _system database in order to execute this call.- Specified by:
create
in interfaceUserOperations
- Parameters:
passwd
- The user passwordoptions
- Additional options, can be null- Returns:
- information about the user
- Throws:
DataAccessException
-
update
public com.arangodb.entity.UserEntity update(com.arangodb.model.UserUpdateOptions options) throws DataAccessException Description copied from interface:UserOperations
Partially updates the data of an existing user. You can only change the password of your self. You need access to the _system database to change the active flag.- Specified by:
update
in interfaceUserOperations
- Parameters:
options
- Properties of the user to be changed- Returns:
- information about the user
- Throws:
DataAccessException
-
replace
public com.arangodb.entity.UserEntity replace(com.arangodb.model.UserUpdateOptions options) throws DataAccessException Description copied from interface:UserOperations
Replaces the data of an existing user. You can only change the password of your self. You need access to the _system database to change the active flag.- Specified by:
replace
in interfaceUserOperations
- Parameters:
options
- Additional properties of the user, can be null- Returns:
- information about the user
- Throws:
DataAccessException
-
delete
Description copied from interface:UserOperations
Removes an existing user, identified by user. You need access to the _system database.- Specified by:
delete
in interfaceUserOperations
- Throws:
DataAccessException
-
grantDefaultDatabaseAccess
public void grantDefaultDatabaseAccess(com.arangodb.entity.Permissions permissions) throws DataAccessException Description copied from interface:UserOperations
Sets the default access level for databases for the user. You need permission to the _system database in order to execute this call.- Specified by:
grantDefaultDatabaseAccess
in interfaceUserOperations
- Parameters:
permissions
- The permissions the user grant- Throws:
DataAccessException
-
grantDatabaseAccess
public void grantDatabaseAccess(com.arangodb.entity.Permissions permissions) throws DataAccessException Description copied from interface:UserOperations
Grants or revoke access to the database for the user. You need permission to the _system database in order to execute this call.- Specified by:
grantDatabaseAccess
in interfaceUserOperations
- Parameters:
permissions
- The permissions the user grant- Throws:
DataAccessException
-
resetDatabaseAccess
Description copied from interface:UserOperations
Clear the database access level, revert back to the default access level.- Specified by:
resetDatabaseAccess
in interfaceUserOperations
- Throws:
DataAccessException
-
grantDefaultCollectionAccess
public void grantDefaultCollectionAccess(com.arangodb.entity.Permissions permissions) throws DataAccessException Description copied from interface:UserOperations
Sets the default access level for collections for the user. You need permission to the _system database in order to execute this call.- Specified by:
grantDefaultCollectionAccess
in interfaceUserOperations
- Parameters:
permissions
- The permissions the user grant- Throws:
DataAccessException
-
grantCollectionAccess
public void grantCollectionAccess(Class<?> type, com.arangodb.entity.Permissions permissions) throws DataAccessException Description copied from interface:UserOperations
Grants or revoke access to the collection for user. You need permission to the _system database in order to execute this call.- Specified by:
grantCollectionAccess
in interfaceUserOperations
- Parameters:
type
- The entity type representing the collectionpermissions
- The permissions the user grant- Throws:
DataAccessException
-
grantCollectionAccess
public void grantCollectionAccess(String name, com.arangodb.entity.Permissions permissions) throws DataAccessException Description copied from interface:UserOperations
Grants or revoke access to the collection for user. You need permission to the _system database in order to execute this call.- Specified by:
grantCollectionAccess
in interfaceUserOperations
- Parameters:
name
- The name of the collectionpermissions
- The permissions the user grant- Throws:
DataAccessException
-
resetCollectionAccess
Description copied from interface:UserOperations
Clear the collection access level, revert back to the default access level.- Specified by:
resetCollectionAccess
in interfaceUserOperations
- Parameters:
type
- The entity type representing the collection- Throws:
DataAccessException
-
resetCollectionAccess
Description copied from interface:UserOperations
Clear the collection access level, revert back to the default access level.- Specified by:
resetCollectionAccess
in interfaceUserOperations
- Parameters:
name
- The name of the collection- Throws:
DataAccessException
-
getDatabasePermissions
Description copied from interface:UserOperations
Get specific database access level- Specified by:
getDatabasePermissions
in interfaceUserOperations
- Returns:
- permissions of the user
- Throws:
DataAccessException
-
getCollectionPermissions
public com.arangodb.entity.Permissions getCollectionPermissions(Class<?> type) throws DataAccessException Description copied from interface:UserOperations
Get the collection access level- Specified by:
getCollectionPermissions
in interfaceUserOperations
- Parameters:
type
- The entity type representing the collection- Returns:
- permissions of the user
- Throws:
DataAccessException
-
getCollectionPermissions
public com.arangodb.entity.Permissions getCollectionPermissions(String name) throws DataAccessException Description copied from interface:UserOperations
Get the collection access level- Specified by:
getCollectionPermissions
in interfaceUserOperations
- Parameters:
name
- The name of the collection- Returns:
- permissions of the user
- Throws:
DataAccessException
-