Interface GateKeeper
- All Known Implementing Classes:
DownloadGateKeeper
public interface GateKeeper
Manages the granting of temporary permissions to retrieve resources. It is assumed that all resources managed
by a GateKeeper are restricted, with permission being granted for particular users to particular resources.
Resources are identified by a path (usually relative to some directory or URI root), the meaning of the path
is implementation-dependent.
Implementations of this interface are responsible for expiring permissions after some reasonable time period
The interface was written to manage access to Confluence's temp directory, from which exports and backups can only be downloaded by the user who created them.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addKey
(String path, com.atlassian.user.User user, Predicate<? super ConfluenceUser> permissionPredicate) void
addKey
(String path, String userName, Predicate<? super ConfluenceUser> permissionPredicate) void
allowAnonymousAccess
(String path, Predicate<? super ConfluenceUser> permissionPredicate) void
Revoke all granted permissions.boolean
isAccessPermitted
(String path, com.atlassian.user.User user) Determine whether a user is permitted to access a resource.boolean
isAccessPermitted
(String path, String userName) Determine whether a user is permitted to access a resource.
-
Method Details
-
addKey
void addKey(String path, com.atlassian.user.User user, Predicate<? super ConfluenceUser> permissionPredicate) -
addKey
-
isAccessPermitted
Determine whether a user is permitted to access a resource.- Parameters:
path
- the path to the resource being requesteduser
- the user requesting permission to retrieve that resource- Returns:
- true if the user is permitted to retrieve that resource, false otherwise
-
isAccessPermitted
Determine whether a user is permitted to access a resource.- Parameters:
path
- the path to the resource being requesteduserName
- the name of the user requesting permission to retrieve that resource- Returns:
- true if the user is permitted to retrieve that resource, false otherwise
-
cleanAllKeys
void cleanAllKeys()Revoke all granted permissions. -
allowAnonymousAccess
-