Interface IAclNodeHelper
public interface IAclNodeHelper
The interface for operations over ACL nodes.
Certain entities, such as data sources, are stored in areas of the repository in which non-admin users have no natural access. In order to provide ACLs on these entities surrogate nodes are created which store the ACLs instead. Implementations of this class are responsible for storing and querying these surrogate ACL nodes.
- Author:
- Andrey Khayrutdinov, Nick Baker
-
Method Summary
Modifier and TypeMethodDescriptionboolean
canAccess
(RepositoryFile repositoryFile, EnumSet<RepositoryFilePermission> permissions) Returnstrue
if the current user has access torepositoryFile
by way of ACL node.getAclFor
(RepositoryFile repositoryFile) Returns an ACL forrepositoryFile
.void
removeAclFor
(RepositoryFile repositoryFile) Deletes the ACL node associated with therepositoryFile
if it exists.void
setAclFor
(RepositoryFile repositoryFile, RepositoryFileAcl acl) Setsacl
forrepositoryFile
.
-
Method Details
-
canAccess
Returnstrue
if the current user has access torepositoryFile
by way of ACL node.- Parameters:
repositoryFile
- file for which to check access by ACL nodepermissions
- EnumSet of permissions to check against the repositoryFile- Returns:
true
if the user can access the Repository File governed by this ACL node
-
getAclFor
Returns an ACL forrepositoryFile
. If none exists,null
is returned. Note: this method should be invoked with 'repository admin' privileges.- Parameters:
repositoryFile
- file for which to retrieve ACLs for- Returns:
- ACL rules if exist or
null
otherwise
-
setAclFor
Setsacl
forrepositoryFile
. If a ACL node does not exist, it is created. Ifacl
isnull
, the ACL node is removed.- Parameters:
repositoryFile
- data sourceacl
- an ACL rules for the data source
-
removeAclFor
Deletes the ACL node associated with therepositoryFile
if it exists.- Parameters:
repositoryFile
- data source
-