2.17.2: 2011-06-17

net.sf.basedb.clients.web
Class PermissionUtil

java.lang.Object
  extended by 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: 2010-12-02 14:35:04 +0100 (Thu, 02 Dec 2010) $

Field Summary
private static Set<Item> ignored
          All items which permissions depend on some other item only.
private static Map<String,List<Item>> permissionGroups
           
 
Constructor Summary
PermissionUtil()
           
 
Method Summary
static String getFullPermissionNames(Identifiable item)
           
static String getFullPermissionNames(Set<Permission> permissions)
          Create a comma-separated string with "readable" permission names.
static 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.
static Map<String,List<Item>> getPermissionGroups()
           
static Set<Permission> getPermissions(int permissionCode)
          Translate a given integer to a set of permissions.
static String getShortPermissions(Identifiable item)
           
static String translatePermissionsToString(Set<Permission> permissions)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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 Detail

PermissionUtil

public PermissionUtil()
Method Detail

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)
Create a comma-separated string with "readable" permission names.

Since:
2.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(int)

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:
getPermissionCode(Set)

getPermissionGroups

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

translatePermissionsToString

public static String translatePermissionsToString(Set<Permission> permissions)

2.17.2: 2011-06-17