2.17.2: 2011-06-17

net.sf.basedb.core.plugin
Class Permissions

java.lang.Object
  extended by net.sf.basedb.core.plugin.Permissions

public class Permissions
extends Object

This class holds permissions requested by a plugin. The server admin may or may not grant all requested permissions.

Version:
2.0
Author:
nicklas
Last modified
$Date: 2008-09-11 22:09:17 +0200 (Thu, 11 Sep 2008) $

Field Summary
private  Set<Permission> alwaysGranted
           
private  Item itemType
           
private  Set<Permission> maybeGranted
           
 
Constructor Summary
Permissions(Item itemType, Set<Permission> alwaysGranted, Set<Permission> maybeGranted)
           
 
Method Summary
 Set<Permission> getAlwaysGranted()
          Get the permissions that the plugin always should be granted, even if the logged in user doesn't have the permissions already.
 Item getItemType()
          Get the item type the permissions are valid for.
 Set<Permission> getMaybeGranted()
          Get the permissions that the plugin should be granted only if the logged in user already have the permissions.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

itemType

private final Item itemType

alwaysGranted

private final Set<Permission> alwaysGranted

maybeGranted

private final Set<Permission> maybeGranted
Constructor Detail

Permissions

public Permissions(Item itemType,
                   Set<Permission> alwaysGranted,
                   Set<Permission> maybeGranted)
Method Detail

getItemType

public Item getItemType()
Get the item type the permissions are valid for.


getAlwaysGranted

public Set<Permission> getAlwaysGranted()
Get the permissions that the plugin always should be granted, even if the logged in user doesn't have the permissions already. This makes it possible for a plugin to do things that a user normally can't do.

Returns:
A set with the permissions to grant, ot null to not grant any permissions

getMaybeGranted

public Set<Permission> getMaybeGranted()
Get the permissions that the plugin should be granted only if the logged in user already have the permissions. This is the normal operation for plugins which doesn't use permissions at all, but must be specified if permissions are used since the default is then to deny everything.

Returns:
A set with the permissions to grant, ot null to not grant any permissions

toString

public String toString()
Overrides:
toString in class Object

2.17.2: 2011-06-17