|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | PROPERTY | CONSTR | METHOD | DETAIL: FIELD | PROPERTY | CONSTR | METHOD |
java.lang.Objectutils.gate.cow.CowPermission
class CowPermission
A CowPermission represents the ability of a CoW user to perform actions on wiki pages. Permission is given for specificied actions on a specified controller. Some controllers and actions are system-wide: general auth and auth controllers, or maybe plugin controllers. Where the controller is serving actual wiki pages, then the wiki is also specified, as are regular expressions for directories to be included and excluded by the permission. Permission can therefore be described at a granularity of directories within a specified wiki.
Borrows ideas and code from org.jsecurity.grails.JsecBasicPermission
Property Summary | |
---|---|
static String |
WILDCARD
wildcard |
private Set |
actions
The actions described by this Permission |
private String |
controller
The controller described by this Permission |
private String |
excludeDir
Directories excluded by this Permission, as a regular expression relative to the wiki. |
private String |
includeDir
Directories included by this Permission, as a regular expression relative to the wiki. |
static Logger |
log
Logger |
private String |
requiredDir
Directory required by this Permission, as a path relative to the wiki. |
private String |
wiki
The id of the wiki described by this Permission |
Constructor Summary | |
CowPermission(Map pageMap, String controller, String actions)
Construct a permission from a page description, controller, and an action. |
|
CowPermission(String wiki, String incDir, String exDir, String controller, String actions)
Creates a new permission with the given controller and actions to be permitted on a controller, in the scope of inicluded and excluded directory regex relative to a wiki. |
|
CowPermission(String wiki, String requiredDir, String controller, String actions)
Creates a new permission with the given controller and actions to be permitted on a controller, in the scope of a directory. |
Method Summary | |
---|---|
boolean
|
equals(Object obj)
Is this CowPermission equal to another object? |
int
|
hashCode()
Hash code for this permission |
boolean
|
implies(Permission p)
Returns |
String
|
toString()
String representaiton of this CowPermission |
Methods inherited from class Object | |
---|---|
wait, wait, wait, hashCode, getClass, equals, toString, notify, notifyAll |
Property Detail |
---|
public static final String WILDCARD
private Set actions
private String controller
private String excludeDir
private String includeDir
static Logger log
private String requiredDir
private String wiki
Constructor Detail |
---|
public CowPermission(Map pageMap, String controller, String actions)
public CowPermission(String wiki, String incDir, String exDir, String controller, String actions)
public CowPermission(String wiki, String requiredDir, String controller, String actions)
Method Detail |
---|
public boolean equals(Object obj)
public int hashCode()
public boolean implies(Permission p)
true
if this permission (the configured one) implies
the parameter permission (the required one), otherwise
false
. This method checks that the required permission has
the same controller as this one, the same wiki as this one, that the
required permission has a directory path that matches the included
directory pattern, does not match the excluded directory pattern, and
this permission has a super-set of the actions of the required permission.
The wildcard matches all actions. Note that included directiry patterns are
applied before excluded directory patterns, and so the latter overrides the
former.
public String toString()
Groovy Documentation