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, SCHEDULER_EXECUTE_ACTION
-
Constructor Summary
ConstructorDescriptionKettleDatabaseRepositorySecurityProvider
(KettleDatabaseRepository repository, RepositoryMeta repositoryMeta, IUser userInfo) -
Method Summary
Modifier and TypeMethodDescriptionboolean
allowsVersionComments
(String fullPath) void
deleteUsers
(List<IUser> users) void
void
delUser
(org.pentaho.di.repository.ObjectId id_user) Retrieves all roles in the systemRetrieves all users in the systemorg.pentaho.di.repository.ObjectId
org.pentaho.di.repository.ObjectId[]
String[]
getUsers()
boolean
boolean
boolean
boolean
boolean
isVersioningEnabled
(String fullPath) Determines whether versioning should be enabled in the UI for the given fully qualified file/path.loadUserInfo
(String login) void
normalizeUserInfo
(IUser user) Performs normalization overuser
due to validation rules. Note: normalized is not guaranteed to pass validation rulesvoid
renameUser
(org.pentaho.di.repository.ObjectId id_user, String newname) void
saveUserInfo
(IUser userInfo) This method creates new user after all validations have been done.void
void
updateUser
(IUser user) void
validateAction
(RepositoryOperation... operations) Validates the supplied operation.boolean
validateUserInfo
(IUser user) Validatesuser
and returnstrue
if 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 Details
-
KettleDatabaseRepositorySecurityProvider
public KettleDatabaseRepositorySecurityProvider(KettleDatabaseRepository repository, RepositoryMeta repositoryMeta, IUser userInfo) - Parameters:
repository
-userInfo
-
-
-
Method Details
-
isReadOnly
public boolean isReadOnly()- Specified by:
isReadOnly
in interfaceRepositorySecurityProvider
- Returns:
- true if the repository or the user is read only
-
isLockingPossible
public boolean isLockingPossible()- Specified by:
isLockingPossible
in interfaceRepositorySecurityProvider
- Returns:
- true if this repository supports file locking and if the user is allowed to lock a file
-
allowsVersionComments
- Specified by:
allowsVersionComments
in interfaceRepositorySecurityProvider
- Returns:
- true if the repository supports revisions AND if it is possible to give version comments
-
isVersionCommentMandatory
public boolean isVersionCommentMandatory()- Specified by:
isVersionCommentMandatory
in interfaceRepositorySecurityProvider
- Returns:
- true if version comments are mandatory if allowed.
-
loadUserInfo
- Specified by:
loadUserInfo
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
saveUserInfo
This method creates new user after all validations have been done. For updating user's data please use updateUser(IUser).- Specified by:
saveUserInfo
in interfaceRepositorySecurityManager
- Parameters:
userInfo
- user's info- Throws:
org.pentaho.di.core.exception.KettleException
IllegalArgumentException
- 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:RepositorySecurityProvider
Validates the supplied operation.- Specified by:
validateAction
in interfaceRepositorySecurityProvider
- Overrides:
validateAction
in 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:
delUser
in 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:
getUserID
in 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:
getUserIDs
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
getUserLogins
- Specified by:
getUserLogins
in 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:
renameUser
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
deleteUsers
- Specified by:
deleteUsers
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
getUsers
- Specified by:
getUsers
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
setUsers
- Specified by:
setUsers
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
delUser
- Specified by:
delUser
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
updateUser
- Specified by:
updateUser
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
constructUser
- Specified by:
constructUser
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
getAllRoles
Description copied from interface:RepositorySecurityProvider
Retrieves all roles in the system- Specified by:
getAllRoles
in interfaceRepositorySecurityProvider
- Returns:
- list of role
- Throws:
org.pentaho.di.core.exception.KettleSecurityException
- in case anything went wrongorg.pentaho.di.core.exception.KettleException
-
getAllUsers
Description copied from interface:RepositorySecurityProvider
Retrieves all users in the system- Specified by:
getAllUsers
in 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:
isManaged
in interfaceRepositorySecurityManager
- Throws:
org.pentaho.di.core.exception.KettleException
-
isVersioningEnabled
Description copied from interface:RepositorySecurityProvider
Determines 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:
isVersioningEnabled
in interfaceRepositorySecurityProvider
- Returns:
- true if version are enabled, false if they if are not
-
validateUserInfo
Description copied from interface:RepositorySecurityUserValidator
Validatesuser
and returnstrue
if all its data is valid.
Note: this method performs fail-fast approach and does not return any details.- Specified by:
validateUserInfo
in interfaceRepositorySecurityUserValidator
- Parameters:
user
- user's info- Returns:
true
orfalse
depending on whether or not user's info is valid
-
normalizeUserInfo
Description copied from interface:RepositorySecurityUserValidator
Performs normalization overuser
due to validation rules. Note: normalized is not guaranteed to pass validation rules- Specified by:
normalizeUserInfo
in interfaceRepositorySecurityUserValidator
- Parameters:
user
- user's info
-