Class DownloadGateKeeper
java.lang.Object
com.atlassian.confluence.security.DownloadGateKeeper
- All Implemented Interfaces:
GateKeeper
GateKeeper for the Confluence downloads directory.
Any resource granted permissions for will be normalised to remove any part of the path before the first
occurrence of the text download. So /confluence/download/foo.txt will need to be checked
as download/foo.txt. Attempts to grant permission to a path that doesn't contain "download" will throw
an exception.
Permissions will be expired 24 hours after they are granted.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddKey(String path, com.atlassian.user.User user, Predicate<? super ConfluenceUser> permissionPredicate) voidaddKey(String path, String username, Predicate<? super ConfluenceUser> permissionPredicate) voidallowAnonymousAccess(String path, Predicate<? super ConfluenceUser> permissionPredicate) voidRevoke all granted permissions.voidcleanAllKeysOlderThan(long millis) booleanisAccessPermitted(String path, com.atlassian.user.User user) Determine whether a user is permitted to access a resource.booleanisAccessPermitted(String path, String userName) Determine whether a user is permitted to access a resource.
-
Constructor Details
-
DownloadGateKeeper
public DownloadGateKeeper()
-
-
Method Details
-
addKey
public void addKey(String path, String username, Predicate<? super ConfluenceUser> permissionPredicate) - Specified by:
addKeyin interfaceGateKeeper
-
addKey
public void addKey(String path, com.atlassian.user.User user, Predicate<? super ConfluenceUser> permissionPredicate) - Specified by:
addKeyin interfaceGateKeeper
-
allowAnonymousAccess
public void allowAnonymousAccess(String path, Predicate<? super ConfluenceUser> permissionPredicate) - Specified by:
allowAnonymousAccessin interfaceGateKeeper
-
isAccessPermitted
Description copied from interface:GateKeeperDetermine whether a user is permitted to access a resource.- Specified by:
isAccessPermittedin interfaceGateKeeper- 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
Description copied from interface:GateKeeperDetermine whether a user is permitted to access a resource.- Specified by:
isAccessPermittedin interfaceGateKeeper- 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
public void cleanAllKeys()Description copied from interface:GateKeeperRevoke all granted permissions.- Specified by:
cleanAllKeysin interfaceGateKeeper
-
cleanAllKeysOlderThan
public void cleanAllKeysOlderThan(long millis)
-