Class PermissionUtil

java.lang.Object
net.sf.basedb.clients.web.PermissionUtil

public final class PermissionUtil extends Object
This class is used to collect some useful methods for assigning permissions to roles and shared items.
Version:
2.0
Author:
Nicklas
Last modified
$Date: 2019-03-11 12:51:33 +0100 (mån, 11 mars 2019) $
  • Field Details

    • permissionGroups

      private static Map<String,List<Item>> permissionGroups
    • ignored

      private static final Set<Item> ignored
      All items which permissions depend on some other item only.
  • Constructor Details

    • PermissionUtil

      public PermissionUtil()
  • Method Details

    • getShortPermissions

      public static final String getShortPermissions(Identifiable item)
    • getFullPermissionNames

      public static final String getFullPermissionNames(Identifiable item)
    • getFullPermissionNames

      public static final String getFullPermissionNames(Set<Permission> permissions, String restrictedWrite)
      Create a comma-separated string with "readable" permission names.
      Since:
      2.10, 3.10
    • getPermissionCode

      public static final int getPermissionCode(Set<Permission> permissions)
      Translate the given set of permissions to an integer code that can be used to later recreate the set again.
      Parameters:
      permissions - A Set with the permissions
      Returns:
      An integer
      See Also:
    • getPermissions

      public static final Set<Permission> getPermissions(int permissionCode)
      Translate a given integer to a set of permissions.
      Parameters:
      permissionCode - The integer representing permissions
      Returns:
      A Set containing the Permission:s
      See Also:
    • getPermissionGroups

      public static final Map<String,List<Item>> getPermissionGroups()
    • translatePermissionsToString

      public static String translatePermissionsToString(Set<Permission> permissions, String restrictedWrite)