public class DefaultAclManager extends Object implements AclManager
Modifier and Type | Field and Description |
---|---|
static Pattern |
ACL_PATTERN
Identifies ACL strings in wiki text; the first group is the action (view, edit) and
the second is the list of Principals separated by commas.
|
Constructor and Description |
---|
DefaultAclManager() |
Modifier and Type | Method and Description |
---|---|
Acl |
getPermissions(WikiPage page)
Returns the access control list for the page.
|
void |
initialize(WikiEngine engine,
Properties props)
Initializes the AclManager with a supplied wiki engine and properties.
|
Acl |
parseAcl(WikiPage page,
String ruleLine)
A helper method for parsing textual AccessControlLists.
|
protected static String |
printAcl(Acl acl)
Generates an ACL string for inclusion in a wiki page, based on a supplied Acl object.
|
void |
setPermissions(WikiPage page,
Acl acl)
Sets the access control list for the page and persists it by prepending
it to the wiki page markup and saving the page.
|
public static final Pattern ACL_PATTERN
public DefaultAclManager()
public void initialize(WikiEngine engine, Properties props)
initialize
in interface AclManager
engine
- the wiki engineprops
- the initialization propertiesAclManager.initialize(org.apache.wiki.WikiEngine,
java.util.Properties)
public Acl parseAcl(WikiPage page, String ruleLine) throws WikiSecurityException
parseAcl
in interface AclManager
page
- The current wiki page. If the page already has an ACL, it
will be used as a basis for this ACL in order to avoid the
creation of a new one.ruleLine
- The rule line, as described above.WikiSecurityException
- if the ruleLine was faulty somehow.public Acl getPermissions(WikiPage page)
null
Acl.getPermissions
in interface AclManager
page
- the pagepublic void setPermissions(WikiPage page, Acl acl) throws WikiSecurityException
setPermissions
in interface AclManager
page
- the wiki pageacl
- the access control listWikiSecurityException
- of the Acl cannot be setprotected static String printAcl(Acl acl)
acl
- the ACLCopyright © 2001-2019 The Apache Software Foundation. All rights reserved.