|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.atlassian.confluence.security.DownloadGateKeeper
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.
All permissions will be expired once every 24 hours, regardless of their age. This is dumb.
Field Summary | |
static long |
ONE_DAY
|
static Map |
permittedDownloads
|
Constructor Summary | |
DownloadGateKeeper()
|
Method Summary | |
void |
addKey(String path,
User user)
Add permission for a user to access a certain path. |
void |
allowAnonymousAccess(String path)
Allow all users, including the anonymous user, access to a particular path. |
void |
cleanAllKeys()
Revoke all granted permissions. |
boolean |
isAccessPermitted(String path,
User user)
Determine if a user is permitted to access a resource. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final Map permittedDownloads
public static final long ONE_DAY
Constructor Detail |
public DownloadGateKeeper()
Method Detail |
public void addKey(String path, User user)
/confluence/download/Foo
will be
normalised to download/Foo
- Specified by:
addKey
in interface GateKeeper
- Parameters:
user
- the user to grant permission forpath
- the path being granted permission to. Must not be null.
- Throws:
IllegalArgumentException
- if the path is not of the expected form
public void allowAnonymousAccess(String path)
addKey(java.lang.String, com.atlassian.user.User)
allowAnonymousAccess
in interface GateKeeper
path
- The resource to grant access permission topublic boolean isAccessPermitted(String path, User user)
GateKeeper
isAccessPermitted
in interface GateKeeper
path
- the path to the resource being requesteduser
- the user requesting permission to retrieve that resource
public void cleanAllKeys()
GateKeeper
cleanAllKeys
in interface GateKeeper
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |