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
  • Constructor Details

  • Method Details

    • isReadOnly

      public boolean isReadOnly()
      Specified by:
      isReadOnly in interface RepositorySecurityProvider
      Returns:
      true if the repository or the user is read only
    • isLockingPossible

      public boolean isLockingPossible()
      Specified by:
      isLockingPossible in interface RepositorySecurityProvider
      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:
      allowsVersionComments in interface RepositorySecurityProvider
      Returns:
      true if the repository supports revisions AND if it is possible to give version comments
    • isVersionCommentMandatory

      public boolean isVersionCommentMandatory()
      Specified by:
      isVersionCommentMandatory in interface RepositorySecurityProvider
      Returns:
      true if version comments are mandatory if allowed.
    • loadUserInfo

      public IUser loadUserInfo(String login) throws org.pentaho.di.core.exception.KettleException
      Specified by:
      loadUserInfo in interface RepositorySecurityManager
      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:
      saveUserInfo in interface RepositorySecurityManager
      Parameters:
      userInfo - user's info
      Throws:
      org.pentaho.di.core.exception.KettleException
      IllegalArgumentException - if userInfo.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 interface RepositorySecurityProvider
      Overrides:
      validateAction in class BaseRepositorySecurityProvider
      Throws:
      org.pentaho.di.core.exception.KettleSecurityException - in case the provided user is not know or the password is incorrect
      org.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 interface RepositorySecurityManager
      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 interface RepositorySecurityManager
      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 interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • getUserLogins

      public String[] getUserLogins() throws org.pentaho.di.core.exception.KettleException
      Specified by:
      getUserLogins in interface RepositorySecurityProvider
      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 interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • deleteUsers

      public void deleteUsers(List<IUser> users) throws org.pentaho.di.core.exception.KettleException
      Specified by:
      deleteUsers in interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • getUsers

      public List<IUser> getUsers() throws org.pentaho.di.core.exception.KettleException
      Specified by:
      getUsers in interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • setUsers

      public void setUsers(List<IUser> users) throws org.pentaho.di.core.exception.KettleException
      Specified by:
      setUsers in interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • delUser

      public void delUser(String name) throws org.pentaho.di.core.exception.KettleException
      Specified by:
      delUser in interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • updateUser

      public void updateUser(IUser user) throws org.pentaho.di.core.exception.KettleException
      Specified by:
      updateUser in interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • constructUser

      public IUser constructUser() throws org.pentaho.di.core.exception.KettleException
      Specified by:
      constructUser in interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • getAllRoles

      public List<String> getAllRoles() throws org.pentaho.di.core.exception.KettleException
      Description copied from interface: RepositorySecurityProvider
      Retrieves all roles in the system
      Specified by:
      getAllRoles in interface RepositorySecurityProvider
      Returns:
      list of role
      Throws:
      org.pentaho.di.core.exception.KettleSecurityException - in case anything went wrong
      org.pentaho.di.core.exception.KettleException
    • getAllUsers

      public List<String> getAllUsers() throws org.pentaho.di.core.exception.KettleException
      Description copied from interface: RepositorySecurityProvider
      Retrieves all users in the system
      Specified by:
      getAllUsers in interface RepositorySecurityProvider
      Returns:
      list of username
      Throws:
      org.pentaho.di.core.exception.KettleSecurityException - in case anything went wrong
      org.pentaho.di.core.exception.KettleException
    • isManaged

      public boolean isManaged() throws org.pentaho.di.core.exception.KettleException
      Specified by:
      isManaged in interface RepositorySecurityManager
      Throws:
      org.pentaho.di.core.exception.KettleException
    • isVersioningEnabled

      public boolean isVersioningEnabled(String fullPath)
      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 interface RepositorySecurityProvider
      Returns:
      true if version are enabled, false if they if are not
    • validateUserInfo

      public boolean validateUserInfo(IUser user)
      Description copied from interface: RepositorySecurityUserValidator
      Validates user and returns true if all its data is valid.
      Note: this method performs fail-fast approach and does not return any details.
      Specified by:
      validateUserInfo in interface RepositorySecurityUserValidator
      Parameters:
      user - user's info
      Returns:
      true or false depending on whether or not user's info is valid
    • normalizeUserInfo

      public void normalizeUserInfo(IUser user)
      Description copied from interface: RepositorySecurityUserValidator
      Performs normalization over user due to validation rules.
      Note: normalized is not guaranteed to pass validation rules
      Specified by:
      normalizeUserInfo in interface RepositorySecurityUserValidator
      Parameters:
      user - user's info