Package org.apache.wiki.auth.permissions
Class WikiPermission
- java.lang.Object
- 
- java.security.Permission
- 
- org.apache.wiki.auth.permissions.WikiPermission
 
 
- 
- All Implemented Interfaces:
- java.io.Serializable,- java.security.Guard
 
 public final class WikiPermission extends java.security.Permission implements java.io.Serializable Permission to perform an global wiki operation, such as self-registering or creating new pages. Permission actions include: createGroups,createPages,editPreferences,editProfileandlogin.The target is a given wiki. The syntax for the target is the wiki name. "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. Certain permissions imply others. Currently, createGroupsimpliescreatePages.- Since:
- 2.3
- See Also:
- Serialized Form
 
- 
- 
Field SummaryFields Modifier and Type Field Description static WikiPermissionCREATE_GROUPSA static instance of the createGroups permission.static java.lang.StringCREATE_GROUPS_ACTIONName of the action for createGroups permission.static WikiPermissionCREATE_PAGESA static instance of the createPages permission.static java.lang.StringCREATE_PAGES_ACTIONName of the action for createPages permission.static WikiPermissionEDIT_PREFERENCESA static instance of the editPreferences permission.static java.lang.StringEDIT_PREFERENCES_ACTIONName of the action for editPreferences permission.static WikiPermissionEDIT_PROFILEA static instance of the editProfile permission.static java.lang.StringEDIT_PROFILE_ACTIONName of the action for editProfile permission.static WikiPermissionLOGINA static instance of the login permission.static java.lang.StringLOGIN_ACTIONName of the action for login permission.static java.lang.StringWILDCARDValue for a generic wildcard.
 - 
Constructor SummaryConstructors Constructor Description WikiPermission(java.lang.String wiki, java.lang.String actions)Creates a new WikiPermission for a specified set of actions.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)Two WikiPermission objects are considered equal if their wikis and actions (after normalization) are equal.java.lang.StringgetActions()Returns the actions for this permission: "createGroups", "createPages", "editPreferences", "editProfile", or "login".java.lang.StringgetWiki()Returns the name of the wiki containing the page represented by this permission; may return the wildcard string.inthashCode()Returns the hash code for this WikiPermission.booleanimplies(java.security.Permission permission)WikiPermission can only imply other WikiPermissions; no other permission types are implied.java.security.PermissionCollectionnewPermissionCollection()Returns a newAllPermissionCollection.java.lang.StringtoString()Prints a human-readable representation of this permission.
 
- 
- 
- 
Field Detail- 
CREATE_GROUPS_ACTIONpublic static final java.lang.String CREATE_GROUPS_ACTION Name of the action for createGroups permission.- See Also:
- Constant Field Values
 
 - 
CREATE_PAGES_ACTIONpublic static final java.lang.String CREATE_PAGES_ACTION Name of the action for createPages permission.- See Also:
- Constant Field Values
 
 - 
LOGIN_ACTIONpublic static final java.lang.String LOGIN_ACTION Name of the action for login permission.- See Also:
- Constant Field Values
 
 - 
EDIT_PREFERENCES_ACTIONpublic static final java.lang.String EDIT_PREFERENCES_ACTION Name of the action for editPreferences permission.- See Also:
- Constant Field Values
 
 - 
EDIT_PROFILE_ACTIONpublic static final java.lang.String EDIT_PROFILE_ACTION Name of the action for editProfile permission.- See Also:
- Constant Field Values
 
 - 
WILDCARDpublic static final java.lang.String WILDCARD Value for a generic wildcard.- See Also:
- Constant Field Values
 
 - 
CREATE_GROUPSpublic static final WikiPermission CREATE_GROUPS A static instance of the createGroups permission.
 - 
CREATE_PAGESpublic static final WikiPermission CREATE_PAGES A static instance of the createPages permission.
 - 
LOGINpublic static final WikiPermission LOGIN A static instance of the login permission.
 - 
EDIT_PREFERENCESpublic static final WikiPermission EDIT_PREFERENCES A static instance of the editPreferences permission.
 - 
EDIT_PROFILEpublic static final WikiPermission EDIT_PROFILE A static instance of the editProfile permission.
 
- 
 - 
Constructor Detail- 
WikiPermissionpublic WikiPermission(java.lang.String wiki, java.lang.String actions) Creates a new WikiPermission for a specified set of actions.- Parameters:
- actions- the actions for this permission
- wiki- The name of the wiki the permission belongs to.
 
 
- 
 - 
Method Detail- 
equalspublic boolean equals(java.lang.Object obj) Two WikiPermission objects are considered equal if their wikis and actions (after normalization) are equal.- Specified by:
- equalsin class- java.security.Permission
- Parameters:
- obj- the object to test
- Returns:
- the result
- See Also:
- Object.equals(java.lang.Object)
 
 - 
getActionspublic java.lang.String getActions() Returns the actions for this permission: "createGroups", "createPages", "editPreferences", "editProfile", or "login". The actions will always be sorted in alphabetic order, and will always appear in lower case.- Specified by:
- getActionsin class- java.security.Permission
- Returns:
- the actions
- See Also:
- Permission.getActions()
 
 - 
getWikipublic java.lang.String getWiki() Returns the name of the wiki containing the page represented by this permission; may return the wildcard string.- Returns:
- the wiki
 
 - 
hashCodepublic int hashCode() Returns the hash code for this WikiPermission.- Specified by:
- hashCodein class- java.security.Permission
- Returns:
 
 - 
impliespublic boolean implies(java.security.Permission permission) WikiPermission can only imply other WikiPermissions; no other permission types are implied. One WikiPermission implies another if all of the other WikiPermission's actions are equal to, or a subset of, those for this permission.- Specified by:
- impliesin class- java.security.Permission
- Parameters:
- permission- the permission which may (or may not) be implied by this instance
- Returns:
- trueif the permission is implied,- falseotherwise
- See Also:
- Permission.implies(java.security.Permission)
 
 - 
newPermissionCollectionpublic java.security.PermissionCollection newPermissionCollection() Returns a newAllPermissionCollection.- Overrides:
- newPermissionCollectionin class- java.security.Permission
- Returns:
 
 - 
toStringpublic java.lang.String toString() Prints a human-readable representation of this permission.- Overrides:
- toStringin class- java.security.Permission
- Returns:
 
 
- 
 
-