Class Permission

  • All Implemented Interfaces:
    java.io.Serializable

    public final class Permission
    extends EventTarget<PermissionEvent>
    implements java.io.Serializable
    An object representing a permission.
    Since:
    1.4.0, 1.5.0 Changed implementation
    See Also:
    Serialized Form
    • Method Detail

      • getName

        public java.lang.String getName()
        Returns the name of the permission.
        Returns:
        the name of the permission
      • nameProperty

        public javafx.beans.property.StringProperty nameProperty()
      • enabledProperty

        public javafx.beans.property.BooleanProperty enabledProperty()
      • setOnEnabled

        public void setOnEnabled​(EventHandler<PermissionEvent> e)
        Sets the event handler that will fire when the permission is enabled.
        Parameters:
        e - the event handler
      • setOnDisabled

        public void setOnDisabled​(EventHandler<PermissionEvent> e)
        Sets the event handler that will fire when the permission is disabled.
        Parameters:
        e - the event handler
      • getOnEnabled

        public EventHandler<PermissionEvent> getOnEnabled()
        Returns the event handler that will fire when the permission is disabled.
        Returns:
        the event handler that will fire when the permission is disabled
      • onEnabledProperty

        public javafx.beans.property.ObjectProperty<PermissionEvent> onEnabledProperty()
      • getOnDisabled

        public EventHandler<PermissionEvent> getOnDisabled()
        Returns the event handler that will fire when the permission is disabled.
        Returns:
        the event handler that will fire when the permission is disabled
      • onDisabledProperty

        public javafx.beans.property.ObjectProperty<PermissionEvent> onDisabledProperty()
      • enable

        public void enable()
        Enables the permission and all child permissions.
      • disable

        public void disable()
        Disables the permission and all child permissions.
      • setEnabled

        public void setEnabled​(boolean enabled)
        Sets the permission status.
        Parameters:
        enabled - the boolean to set
      • isEnabled

        public boolean isEnabled()
        Returns true if the permission is enabled.
        Returns:
        true if the permission is enabled
      • isDisabled

        public boolean isDisabled()
        Returns true if the permission is disabled.
        Returns:
        true if the permission is disabled
      • getChildPermissions

        public java.util.Set<java.lang.String> getChildPermissions()
        Returns a list of child permissions.
        Returns:
        a list of child permissions
      • hasChildPermission

        public boolean hasChildPermission​(java.lang.String name)
        Checks if the permission has the specified child permission.
        Parameters:
        name - the name of the permission to check
        Returns:
        true if the permission has the specified child permission
        Since:
        1.5.0
      • hasChildPermissions

        public boolean hasChildPermissions​(java.util.HashSet<java.lang.String> names)
        Checks if the permission has the specified child permissions.
        Parameters:
        names - the names of the permissions to check
        Returns:
        true if the permission has the specified child permissions
        Since:
        1.5.0
      • addNewChildPermission

        public boolean addNewChildPermission​(java.lang.String name)
        Adds new permission with the specified name, disabled by default.
        Parameters:
        name - the name of the new permission
        Returns:
        false if permission already exists
      • addAndEnableNewChildPermission

        public boolean addAndEnableNewChildPermission​(java.lang.String name)
        Adds new permission with the specified name, enabled by default.
        Parameters:
        name - the name of the new permission
        Returns:
        false if permission already exists
      • removeChildPermission

        public boolean removeChildPermission​(java.lang.String name)
        Removes the specified permission as a child.
        Parameters:
        name - the name of the permission to remove
        Returns:
        false if the permission is not a child
      • copyToNewParent

        public boolean copyToNewParent​(java.lang.String newParentName)
        Attempts to inclusively copy a permission to another parent. This method copies all child permissions and all event handlers.
        Parameters:
        newParentName - the name of the new parent to copy to
        Returns:
        true if copy succeeds
        Since:
        1.5.0
      • enableDebugLogging

        public void enableDebugLogging()
        Enables basic event handlers with System.Out logging for all events.
        Since:
        1.5.0
      • disableDebugLogging

        public void disableDebugLogging()
        Disables basic event handlers with System.Out logging for all events.
        Since:
        1.5.0