Class FileSystemFileAclDao
- java.lang.Object
-
- org.pentaho.platform.repository2.unified.fs.FileSystemFileAclDao
-
- All Implemented Interfaces:
IRepositoryFileAclDao
public class FileSystemFileAclDao extends Object implements IRepositoryFileAclDao
-
-
Constructor Summary
Constructors Constructor Description FileSystemFileAclDao()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addAce(Serializable fileId, org.pentaho.platform.api.repository2.unified.RepositoryFileSid recipient, EnumSet<org.pentaho.platform.api.repository2.unified.RepositoryFilePermission> permission)
Adds ACE to end of ACL.org.pentaho.platform.api.repository2.unified.RepositoryFileAcl
createAcl(Serializable fileId, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl)
Creates an ACL.org.pentaho.platform.api.repository2.unified.RepositoryFileAcl
getAcl(Serializable fileId)
Returns ACL for file.List<org.pentaho.platform.api.repository2.unified.RepositoryFileAce>
getEffectiveAces(Serializable fileId, boolean forceEntriesInheriting)
Returns the list of access control entries that will be used to make an access control decision.boolean
hasAccess(String relPath, EnumSet<org.pentaho.platform.api.repository2.unified.RepositoryFilePermission> permissions)
Returnstrue
if the user has all of the permissions.void
setFullControl(Serializable fileId, org.pentaho.platform.api.repository2.unified.RepositoryFileSid sid, org.pentaho.platform.api.repository2.unified.RepositoryFilePermission permission)
Gives full control (all permissions) to given sid.org.pentaho.platform.api.repository2.unified.RepositoryFileAcl
updateAcl(org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl)
Updates an ACL.
-
-
-
Method Detail
-
addAce
public void addAce(Serializable fileId, org.pentaho.platform.api.repository2.unified.RepositoryFileSid recipient, EnumSet<org.pentaho.platform.api.repository2.unified.RepositoryFilePermission> permission)
Description copied from interface:IRepositoryFileAclDao
Adds ACE to end of ACL. ACL should already have been created.IRepositoryFileAclDao.updateAcl(RepositoryFileAcl)
should not need to be called after this method returns.- Specified by:
addAce
in interfaceIRepositoryFileAclDao
- Parameters:
fileId
- file idrecipient
- recipient of permissionpermission
- permission to set
-
createAcl
public org.pentaho.platform.api.repository2.unified.RepositoryFileAcl createAcl(Serializable fileId, org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl)
Description copied from interface:IRepositoryFileAclDao
Creates an ACL.- Specified by:
createAcl
in interfaceIRepositoryFileAclDao
- Parameters:
fileId
- file idacl
- file acl- Returns:
- acl with id populated
-
getAcl
public org.pentaho.platform.api.repository2.unified.RepositoryFileAcl getAcl(Serializable fileId)
Description copied from interface:IRepositoryFileAclDao
Returns ACL for file.- Specified by:
getAcl
in interfaceIRepositoryFileAclDao
- Parameters:
fileId
- file id- Returns:
- access control list
-
getEffectiveAces
public List<org.pentaho.platform.api.repository2.unified.RepositoryFileAce> getEffectiveAces(Serializable fileId, boolean forceEntriesInheriting)
Description copied from interface:IRepositoryFileAclDao
Returns the list of access control entries that will be used to make an access control decision.- Specified by:
getEffectiveAces
in interfaceIRepositoryFileAclDao
- Parameters:
fileId
- file idforceEntriesInheriting
-true
to treat ACL as ifisEntriesInheriting
was true; this avoids having the caller fetch the parent of ACL belonging to file withfileId
; no change is persisted to the ACL- Returns:
- list of ACEs
-
hasAccess
public boolean hasAccess(String relPath, EnumSet<org.pentaho.platform.api.repository2.unified.RepositoryFilePermission> permissions)
Description copied from interface:IRepositoryFileAclDao
Returnstrue
if the user has all of the permissions. The implementation should returnfalse
if either the user does not have access or the file does not exist.- Specified by:
hasAccess
in interfaceIRepositoryFileAclDao
- Parameters:
relPath
- path to filepermissions
- permissions to check- Returns:
true
if user has access
-
setFullControl
public void setFullControl(Serializable fileId, org.pentaho.platform.api.repository2.unified.RepositoryFileSid sid, org.pentaho.platform.api.repository2.unified.RepositoryFilePermission permission)
Description copied from interface:IRepositoryFileAclDao
Gives full control (all permissions) to given sid.IRepositoryFileAclDao.updateAcl(RepositoryFileAcl)
should not need to be called after this method returns.- Specified by:
setFullControl
in interfaceIRepositoryFileAclDao
- Parameters:
fileId
- file idsid
- sid that should own the domain object associated with this ACL
-
updateAcl
public org.pentaho.platform.api.repository2.unified.RepositoryFileAcl updateAcl(org.pentaho.platform.api.repository2.unified.RepositoryFileAcl acl)
Description copied from interface:IRepositoryFileAclDao
Updates an ACL.- Specified by:
updateAcl
in interfaceIRepositoryFileAclDao
- Parameters:
acl
- ACL to set; must have non-null id- Returns:
- updated ACL
-
-