Package org.pentaho.di.repository.kdr
Class KettleDatabaseRepositorySecurityProvider
- java.lang.Object
-
- org.pentaho.di.repository.BaseRepositorySecurityProvider
-
- org.pentaho.di.repository.kdr.KettleDatabaseRepositorySecurityProvider
-
- All Implemented Interfaces:
IRepositoryService,RepositorySecurityManager,RepositorySecurityProvider,RepositorySecurityUserValidator
public class KettleDatabaseRepositorySecurityProvider extends BaseRepositorySecurityProvider implements RepositorySecurityProvider, RepositorySecurityManager, RepositorySecurityUserValidator
-
-
Field Summary
-
Fields inherited from class org.pentaho.di.repository.BaseRepositorySecurityProvider
repositoryMeta, userInfo
-
Fields inherited from interface org.pentaho.di.repository.RepositorySecurityProvider
ADMINISTER_SECURITY_ACTION, ADMINISTER_SECURITY_ROLE, CREATE_CONTENT_ACTION, CREATE_CONTENT_ROLE, EXECUTE_CONTENT_ACTION, MODIFY_DATABASE_ACTION, NAMESPACE, READ_CONTENT_ACTION, READ_CONTENT_ROLE, SCHEDULE_CONTENT_ACTION
-
-
Constructor Summary
Constructors Constructor Description KettleDatabaseRepositorySecurityProvider(KettleDatabaseRepository repository, RepositoryMeta repositoryMeta, IUser userInfo)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanallowsVersionComments(String fullPath)IUserconstructUser()voiddeleteUsers(List<IUser> users)voiddelUser(String name)voiddelUser(org.pentaho.di.repository.ObjectId id_user)List<String>getAllRoles()Retrieves all roles in the systemList<String>getAllUsers()Retrieves all users in the systemorg.pentaho.di.repository.ObjectIdgetUserID(String login)org.pentaho.di.repository.ObjectId[]getUserIDs()String[]getUserLogins()List<IUser>getUsers()booleanisLockingPossible()booleanisManaged()booleanisReadOnly()booleanisVersionCommentMandatory()booleanisVersioningEnabled(String fullPath)Determines whether versioning should be enabled in the UI for the given fully qualified file/path.IUserloadUserInfo(String login)voidnormalizeUserInfo(IUser user)Performs normalization overuserdue to validation rules. Note: normalized is not guaranteed to pass validation rulesvoidrenameUser(org.pentaho.di.repository.ObjectId id_user, String newname)voidsaveUserInfo(IUser userInfo)This method creates new user after all validations have been done.voidsetUsers(List<IUser> users)voidupdateUser(IUser user)voidvalidateAction(RepositoryOperation... operations)Validates the supplied operation.booleanvalidateUserInfo(IUser user)Validatesuserand returnstrueif all its data is valid.
Note: this method performs fail-fast approach and does not return any details.-
Methods inherited from class org.pentaho.di.repository.BaseRepositorySecurityProvider
getRepositoryMeta, getUserInfo, setRepositoryMeta
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.pentaho.di.repository.RepositorySecurityProvider
getUserInfo
-
-
-
-
Constructor Detail
-
KettleDatabaseRepositorySecurityProvider
public KettleDatabaseRepositorySecurityProvider(KettleDatabaseRepository repository, RepositoryMeta repositoryMeta, IUser userInfo)
- Parameters:
repository-userInfo-
-
-
Method Detail
-
isReadOnly
public boolean isReadOnly()
- Specified by:
isReadOnlyin interfaceRepositorySecurityProvider- Returns:
- true if the repository or the user is read only
-
isLockingPossible
public boolean isLockingPossible()
- Specified by:
isLockingPossiblein interfaceRepositorySecurityProvider- Returns:
- true if this repository supports file locking and if the user is allowed to lock a file
-
allowsVersionComments
public boolean allowsVersionComments(String fullPath)
- Specified by:
allowsVersionCommentsin interfaceRepositorySecurityProvider- Returns:
- true if the repository supports revisions AND if it is possible to give version comments
-
isVersionCommentMandatory
public boolean isVersionCommentMandatory()
- Specified by:
isVersionCommentMandatoryin interfaceRepositorySecurityProvider- Returns:
- true if version comments are mandatory if allowed.
-
loadUserInfo
public IUser loadUserInfo(String login) throws org.pentaho.di.core.exception.KettleException
- Specified by:
loadUserInfoin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
saveUserInfo
public void saveUserInfo(IUser userInfo) throws org.pentaho.di.core.exception.KettleException
This method creates new user after all validations have been done. For updating user's data please use updateUser(IUser).- Specified by:
saveUserInfoin interfaceRepositorySecurityManager- Parameters:
userInfo- user's info- Throws:
org.pentaho.di.core.exception.KettleExceptionIllegalArgumentException- ifuserInfo.getObjectId() != null
-
validateAction
public void validateAction(RepositoryOperation... operations) throws org.pentaho.di.core.exception.KettleException, org.pentaho.di.core.exception.KettleSecurityException
Description copied from interface:RepositorySecurityProviderValidates the supplied operation.- Specified by:
validateActionin interfaceRepositorySecurityProvider- Overrides:
validateActionin classBaseRepositorySecurityProvider- Throws:
org.pentaho.di.core.exception.KettleSecurityException- in case the provided user is not know or the password is incorrectorg.pentaho.di.core.exception.KettleException- in case the action couldn't be validated because of an unexpected problem.
-
delUser
public void delUser(org.pentaho.di.repository.ObjectId id_user) throws org.pentaho.di.core.exception.KettleException- Specified by:
delUserin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
getUserID
public org.pentaho.di.repository.ObjectId getUserID(String login) throws org.pentaho.di.core.exception.KettleException
- Specified by:
getUserIDin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
getUserIDs
public org.pentaho.di.repository.ObjectId[] getUserIDs() throws org.pentaho.di.core.exception.KettleException- Specified by:
getUserIDsin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
getUserLogins
public String[] getUserLogins() throws org.pentaho.di.core.exception.KettleException
- Specified by:
getUserLoginsin interfaceRepositorySecurityProvider- Throws:
org.pentaho.di.core.exception.KettleException
-
renameUser
public void renameUser(org.pentaho.di.repository.ObjectId id_user, String newname) throws org.pentaho.di.core.exception.KettleException- Specified by:
renameUserin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
deleteUsers
public void deleteUsers(List<IUser> users) throws org.pentaho.di.core.exception.KettleException
- Specified by:
deleteUsersin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
getUsers
public List<IUser> getUsers() throws org.pentaho.di.core.exception.KettleException
- Specified by:
getUsersin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
setUsers
public void setUsers(List<IUser> users) throws org.pentaho.di.core.exception.KettleException
- Specified by:
setUsersin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
delUser
public void delUser(String name) throws org.pentaho.di.core.exception.KettleException
- Specified by:
delUserin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
updateUser
public void updateUser(IUser user) throws org.pentaho.di.core.exception.KettleException
- Specified by:
updateUserin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
constructUser
public IUser constructUser() throws org.pentaho.di.core.exception.KettleException
- Specified by:
constructUserin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
getAllRoles
public List<String> getAllRoles() throws org.pentaho.di.core.exception.KettleException
Description copied from interface:RepositorySecurityProviderRetrieves all roles in the system- Specified by:
getAllRolesin interfaceRepositorySecurityProvider- Returns:
- list of role
- Throws:
org.pentaho.di.core.exception.KettleSecurityException- in case anything went wrongorg.pentaho.di.core.exception.KettleException
-
getAllUsers
public List<String> getAllUsers() throws org.pentaho.di.core.exception.KettleException
Description copied from interface:RepositorySecurityProviderRetrieves all users in the system- Specified by:
getAllUsersin interfaceRepositorySecurityProvider- Returns:
- list of username
- Throws:
org.pentaho.di.core.exception.KettleSecurityException- in case anything went wrongorg.pentaho.di.core.exception.KettleException
-
isManaged
public boolean isManaged() throws org.pentaho.di.core.exception.KettleException- Specified by:
isManagedin interfaceRepositorySecurityManager- Throws:
org.pentaho.di.core.exception.KettleException
-
isVersioningEnabled
public boolean isVersioningEnabled(String fullPath)
Description copied from interface:RepositorySecurityProviderDetermines whether versioning should be enabled in the UI for the given fully qualified file/path. If set to false, the repository may still support versioning, but the versioning will not be apparent in the UI.- Specified by:
isVersioningEnabledin interfaceRepositorySecurityProvider- Returns:
- true if version are enabled, false if they if are not
-
validateUserInfo
public boolean validateUserInfo(IUser user)
Description copied from interface:RepositorySecurityUserValidatorValidatesuserand returnstrueif all its data is valid.
Note: this method performs fail-fast approach and does not return any details.- Specified by:
validateUserInfoin interfaceRepositorySecurityUserValidator- Parameters:
user- user's info- Returns:
trueorfalsedepending on whether or not user's info is valid
-
normalizeUserInfo
public void normalizeUserInfo(IUser user)
Description copied from interface:RepositorySecurityUserValidatorPerforms normalization overuserdue to validation rules. Note: normalized is not guaranteed to pass validation rules- Specified by:
normalizeUserInfoin interfaceRepositorySecurityUserValidator- Parameters:
user- user's info
-
-