Class 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, editProfile and login.

    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, createGroups implies createPages.

    Since:
    2.3
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      WikiPermission​(java.lang.String wiki, java.lang.String actions)
      Creates a new WikiPermission for a specified set of actions.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)
      Two WikiPermission objects are considered equal if their wikis and actions (after normalization) are equal.
      java.lang.String getActions()
      Returns the actions for this permission: "createGroups", "createPages", "editPreferences", "editProfile", or "login".
      java.lang.String getWiki()
      Returns the name of the wiki containing the page represented by this permission; may return the wildcard string.
      int hashCode()
      Returns the hash code for this WikiPermission.
      boolean implies​(java.security.Permission permission)
      WikiPermission can only imply other WikiPermissions; no other permission types are implied.
      java.security.PermissionCollection newPermissionCollection()
      java.lang.String toString()
      Prints a human-readable representation of this permission.
      • Methods inherited from class java.security.Permission

        checkGuard, getName
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • WikiPermission

        public 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

      • equals

        public boolean equals​(java.lang.Object obj)
        Two WikiPermission objects are considered equal if their wikis and actions (after normalization) are equal.
        Specified by:
        equals in class java.security.Permission
        Parameters:
        obj - the object to test
        Returns:
        the result
        See Also:
        Object.equals(java.lang.Object)
      • getActions

        public 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:
        getActions in class java.security.Permission
        Returns:
        the actions
        See Also:
        Permission.getActions()
      • getWiki

        public 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
      • hashCode

        public int hashCode()
        Returns the hash code for this WikiPermission.
        Specified by:
        hashCode in class java.security.Permission
        Returns:
      • implies

        public 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:
        implies in class java.security.Permission
        Parameters:
        permission - the permission which may (or may not) be implied by this instance
        Returns:
        true if the permission is implied, false otherwise
        See Also:
        Permission.implies(java.security.Permission)
      • toString

        public java.lang.String toString()
        Prints a human-readable representation of this permission.
        Overrides:
        toString in class java.security.Permission
        Returns: