| java.lang.Object java.security.Permission com.ecyrd.jspwiki.auth.permissions.PagePermission
PagePermission | final public class PagePermission extends Permission (Code) | |
Permission to perform an operation on a single page or collection of pages in
a given wiki. Permission actions include: view ,
edit (edit the text of a wiki page), comment ,
upload , modify (edit text and upload
attachments), delete
and rename .
The target of a permission is a single page or collection in a given wiki.
The syntax for the target is the wiki name, followed by a colon (:) and the
name of the page. "All wikis" can be specified using a wildcard (*). Page
collections may also be specified using a wildcard. For pages, the wildcard
may be a prefix, suffix, or all by itself. Examples of targets include:
*:*
:JanneJalkanen
:Jalkanen
:Janne*
mywiki:JanneJalkanen
mywiki:*Jalkanen
mywiki:Janne*
For a given target, certain permissions imply others:
delete and rename imply edit
modify implies edit and upload
edit implies comment and view
comment and upload imply view
Targets that do not include a wiki prefix never imply others.
author: Andrew Jaquith since: 2.3 |
Method Summary | |
final protected static int | createMask(String actions) Private method that creates a binary mask based on the actions specified. | final public boolean | equals(Object obj) Two PagePermission objects are considered equal if their actions (after
normalization), wiki and target are equal. | final public String | getActions() Returns the actions for this permission: "view", "edit", "comment",
"modify", "upload" or "delete". | final public String | getPage() Returns the name of the wiki page represented by this permission. | final public String | getWiki() Returns the name of the wiki containing the page represented by
this permission; may return the wildcard string. | final public int | hashCode() Returns the hash code for this PagePermission. | final protected static int | impliedMask(int mask) Creates an "implied mask" based on the actions originally assigned: for
example, delete implies modify, comment, upload and view. | final public boolean | implies(Permission permission)
PagePermission can only imply other PagePermissions; no other permission
types are implied. | final protected static boolean | isSubset(String superSet, String subSet) Determines whether one target string is a logical subset of the other. | public PermissionCollection | newPermissionCollection() Returns a new
AllPermissionCollection . | final public String | toString() Prints a human-readable representation of this permission. |
COMMENT_ACTION | final public static String COMMENT_ACTION(Code) | | |
COMMENT_MASK | final protected static int COMMENT_MASK(Code) | | |
DELETE_MASK | final protected static int DELETE_MASK(Code) | | |
EDIT_MASK | final protected static int EDIT_MASK(Code) | | |
MODIFY_MASK | final protected static int MODIFY_MASK(Code) | | |
RENAME_MASK | final protected static int RENAME_MASK(Code) | | |
UPLOAD_MASK | final protected static int UPLOAD_MASK(Code) | | |
VIEW_MASK | final protected static int VIEW_MASK(Code) | | |
PagePermission | public PagePermission(String page, String actions)(Code) | | Creates a new PagePermission for a specified page name and set of
actions. Page should include a prepended wiki name followed by a colon (:).
If the wiki name is not supplied or starts with a colon, the page
refers to no wiki in particular, and will never imply any other
PagePermission.
Parameters: page - the wiki page Parameters: actions - the allowed actions for this page |
PagePermission | public PagePermission(WikiPage page, String actions)(Code) | | Creates a new PagePermission for a specified page and set of actions.
Parameters: page - The wikipage. Parameters: actions - A set of actions; a comma-separated list of actions. |
createMask | final protected static int createMask(String actions)(Code) | | Private method that creates a binary mask based on the actions specified.
This is used by
PagePermission.implies(Permission) .
Parameters: actions - the actions for this permission, separated by commas the binary actions mask |
getActions | final public String getActions()(Code) | | Returns the actions for this permission: "view", "edit", "comment",
"modify", "upload" or "delete". The actions will always be sorted in alphabetic
order, and will always appear in lower case.
See Also: java.security.Permission.getActions |
getPage | final public String getPage()(Code) | | Returns the name of the wiki page represented by this permission.
the page name |
getWiki | final public String getWiki()(Code) | | Returns the name of the wiki containing the page represented by
this permission; may return the wildcard string.
the wiki |
impliedMask | final protected static int impliedMask(int mask)(Code) | | Creates an "implied mask" based on the actions originally assigned: for
example, delete implies modify, comment, upload and view.
Parameters: mask - binary mask for actions binary mask for implied actions |
implies | final public boolean implies(Permission permission)(Code) | |
PagePermission can only imply other PagePermissions; no other permission
types are implied. One PagePermission implies another if its actions if
three conditions are met:
- The other PagePermission's wiki is equal to, or a subset of, that of
this permission. This permission's wiki is considered a superset of the
other if it contains a matching prefix plus a wildcard, or a wildcard
followed by a matching suffix.
- The other PagePermission's target is equal to, or a subset of, the
target specified by this permission. This permission's target is
considered a superset of the other if it contains a matching prefix plus
a wildcard, or a wildcard followed by a matching suffix.
- All of other PagePermission's actions are equal to, or a subset of,
those of this permission
See Also: java.security.Permission.implies(java.security.Permission) |
isSubset | final protected static boolean isSubset(String superSet, String subSet)(Code) | | Determines whether one target string is a logical subset of the other.
Parameters: superSet - the prospective superset Parameters: subSet - the prospective subset the results of the test, where true indicates thatsubSet is a subset of superSet |
|
|