|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.security.DownloadGateKeeper
public class 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.
Permissions will be expired 24 hours after they are granted.
| Constructor Summary | |
|---|---|
DownloadGateKeeper()
|
|
| Method Summary | |
|---|---|
void |
addKey(java.lang.String path,
java.lang.String user)
Add permission for a user to access a certain path. |
void |
addKey(java.lang.String path,
com.atlassian.user.User user)
Permit a user to download a particular resource. |
void |
allowAnonymousAccess(java.lang.String path)
Allow all users, including the anonymous user, access to a particular path. |
void |
cleanAllKeys()
Revoke all granted permissions. |
boolean |
isAccessPermitted(java.lang.String path,
java.lang.String userName)
Determine whether a user is permitted to access a resource. |
boolean |
isAccessPermitted(java.lang.String path,
com.atlassian.user.User user)
Determine whether 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 |
| Constructor Detail |
|---|
public DownloadGateKeeper()
| Method Detail |
|---|
public void addKey(java.lang.String path,
java.lang.String 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:
java.lang.IllegalArgumentException - if the path is not of the expected form
public void addKey(java.lang.String path,
com.atlassian.user.User user)
GateKeeper
addKey in interface GateKeeperpath - the path to the resource being made accessibleuser - the user being given permissionpublic void allowAnonymousAccess(java.lang.String path)
addKey(java.lang.String, java.lang.String)
allowAnonymousAccess in interface GateKeeperpath - The resource to grant access permission to
public boolean isAccessPermitted(java.lang.String path,
com.atlassian.user.User user)
GateKeeper
isAccessPermitted in interface GateKeeperpath - the path to the resource being requesteduser - the user requesting permission to retrieve that resource
public boolean isAccessPermitted(java.lang.String path,
java.lang.String userName)
GateKeeper
isAccessPermitted in interface GateKeeperpath - the path to the resource being requesteduserName - the name of 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 | |||||||||