Class DisplayPermission

java.lang.Object
ch.tocco.nice2.model.menu.api.security.DisplayPermission
All Implemented Interfaces:
Permission, Serializable

public class DisplayPermission extends Object implements Permission
Used to check permission of menu items. This is the only permission unsed in admin-menu system.
See Also:
  • Constructor Details

    • DisplayPermission

      public DisplayPermission()
    • DisplayPermission

      public DisplayPermission(String... items)
      The items represent the path of a menu item. Eg. for menu item with path modules.addressManagement.address you pass modules, addressManagement, address here.
      Parameters:
      items - the item's names
  • Method Details

    • getName

      public String getName()
      Specified by:
      getName in interface Permission
    • implies

      public boolean implies(Permission permission)
      Description copied from interface: Permission
      Check whether this permission implies another permission. Be careful when implementing this method on your own permissions because this is basically the core of the whole security concept.

      A permission implies another permission, if the other permission is a subset of this permission. For example, the permission to access all fields of an entity implies the permission to access the specific field "myField" of the same entity, or the permission to access all files under /my/directory implies the permission to access the file /my/directory/myFile.

      Specified by:
      implies in interface Permission
      Parameters:
      permission - The permission to check.
      Returns:
      true, if this permission implies the given permission, false otherwise.
    • display

      public static DisplayPermission display(MenuItem item)
      Shortcut to create a display permsission
      Parameters:
      item - the item you want to check permission for
      Returns:
      a new display permission
    • getItems

      public String[] getItems()