public class KettleDatabaseRepositorySecurityProvider extends BaseRepositorySecurityProvider implements RepositorySecurityProvider, RepositorySecurityManager, RepositorySecurityUserValidator
repositoryMeta, userInfo
ADMINISTER_SECURITY_ACTION, ADMINISTER_SECURITY_ROLE, CREATE_CONTENT_ACTION, CREATE_CONTENT_ROLE, EXECUTE_CONTENT_ACTION, NAMESPACE, READ_CONTENT_ACTION, READ_CONTENT_ROLE, SCHEDULE_CONTENT_ACTION
Constructor and Description |
---|
KettleDatabaseRepositorySecurityProvider(KettleDatabaseRepository repository,
RepositoryMeta repositoryMeta,
IUser userInfo) |
Modifier and Type | Method and Description |
---|---|
boolean |
allowsVersionComments(String fullPath) |
IUser |
constructUser() |
void |
deleteUsers(List<IUser> users) |
void |
delUser(ObjectId id_user) |
void |
delUser(String name) |
List<String> |
getAllRoles()
Retrieves all roles in the system
|
List<String> |
getAllUsers()
Retrieves all users in the system
|
ObjectId |
getUserID(String login) |
ObjectId[] |
getUserIDs() |
String[] |
getUserLogins() |
List<IUser> |
getUsers() |
boolean |
isLockingPossible() |
boolean |
isManaged() |
boolean |
isReadOnly() |
boolean |
isVersionCommentMandatory() |
boolean |
isVersioningEnabled(String fullPath)
Determines whether versioning should be enabled in the UI for the given fully qualified file/path.
|
IUser |
loadUserInfo(String login) |
void |
normalizeUserInfo(IUser user)
Performs normalization over
user due to validation rules.
Note: normalized is not guaranteed to pass validation rules |
void |
renameUser(ObjectId id_user,
String newname) |
void |
saveUserInfo(IUser userInfo)
This method creates new user after all validations have been done.
|
void |
setUsers(List<IUser> users) |
void |
updateUser(IUser user) |
void |
validateAction(RepositoryOperation... operations)
Validates the supplied operation.
|
boolean |
validateUserInfo(IUser user)
Validates
user and returns true if all its data is valid.Note: this method performs fail-fast approach and does not return any details. |
getRepositoryMeta, getUserInfo, setRepositoryMeta
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getUserInfo
public KettleDatabaseRepositorySecurityProvider(KettleDatabaseRepository repository, RepositoryMeta repositoryMeta, IUser userInfo)
repository
- userInfo
- public boolean isReadOnly()
isReadOnly
in interface RepositorySecurityProvider
public boolean isLockingPossible()
isLockingPossible
in interface RepositorySecurityProvider
public boolean allowsVersionComments(String fullPath)
allowsVersionComments
in interface RepositorySecurityProvider
public boolean isVersionCommentMandatory()
isVersionCommentMandatory
in interface RepositorySecurityProvider
public IUser loadUserInfo(String login) throws KettleException
loadUserInfo
in interface RepositorySecurityManager
KettleException
public void saveUserInfo(IUser userInfo) throws KettleException
saveUserInfo
in interface RepositorySecurityManager
userInfo
- user's infoKettleException
IllegalArgumentException
- if userInfo.getObjectId() != null
public void validateAction(RepositoryOperation... operations) throws KettleException, KettleSecurityException
RepositorySecurityProvider
validateAction
in interface RepositorySecurityProvider
validateAction
in class BaseRepositorySecurityProvider
KettleSecurityException
- in case the provided user is not know or the password is incorrectKettleException
- in case the action couldn't be validated because of an unexpected problem.public void delUser(ObjectId id_user) throws KettleException
delUser
in interface RepositorySecurityManager
KettleException
public ObjectId getUserID(String login) throws KettleException
getUserID
in interface RepositorySecurityManager
KettleException
public ObjectId[] getUserIDs() throws KettleException
getUserIDs
in interface RepositorySecurityManager
KettleException
public String[] getUserLogins() throws KettleException
getUserLogins
in interface RepositorySecurityProvider
KettleException
public void renameUser(ObjectId id_user, String newname) throws KettleException
renameUser
in interface RepositorySecurityManager
KettleException
public void deleteUsers(List<IUser> users) throws KettleException
deleteUsers
in interface RepositorySecurityManager
KettleException
public List<IUser> getUsers() throws KettleException
getUsers
in interface RepositorySecurityManager
KettleException
public void setUsers(List<IUser> users) throws KettleException
setUsers
in interface RepositorySecurityManager
KettleException
public void delUser(String name) throws KettleException
delUser
in interface RepositorySecurityManager
KettleException
public void updateUser(IUser user) throws KettleException
updateUser
in interface RepositorySecurityManager
KettleException
public IUser constructUser() throws KettleException
constructUser
in interface RepositorySecurityManager
KettleException
public List<String> getAllRoles() throws KettleException
RepositorySecurityProvider
getAllRoles
in interface RepositorySecurityProvider
KettleSecurityException
- in case anything went wrongKettleException
public List<String> getAllUsers() throws KettleException
RepositorySecurityProvider
getAllUsers
in interface RepositorySecurityProvider
KettleSecurityException
- in case anything went wrongKettleException
public boolean isManaged() throws KettleException
isManaged
in interface RepositorySecurityManager
KettleException
public boolean isVersioningEnabled(String fullPath)
RepositorySecurityProvider
isVersioningEnabled
in interface RepositorySecurityProvider
public boolean validateUserInfo(IUser user)
RepositorySecurityUserValidator
user
and returns true
if all its data is valid.validateUserInfo
in interface RepositorySecurityUserValidator
user
- user's infotrue
or false
depending on whether or not user's info is validpublic void normalizeUserInfo(IUser user)
RepositorySecurityUserValidator
user
due to validation rules.
Note: normalized is not guaranteed to pass validation rulesnormalizeUserInfo
in interface RepositorySecurityUserValidator
user
- user's infoCopyright © 2018 Hitachi Vantara. All rights reserved.