org.rapla.entities.domain
Interface Permission


public interface Permission

New feature to restrict the access to allocatables on a per user/group basis. Specify absolute and relative booking-timeframes for each resource per user/group. You can, for example, prevent modifing appointments in the past, by setting the relative start-time to 0.


Field Summary
static SmallIntMap ACCESS_LEVEL_NAMEMAP
           
static String[] ACCESS_LEVEL_NAMES
           
static int[] ACCESS_LEVEL_TYPES
           
static int ADMIN
           
static int ALLOCATE
           
static int ALLOCATE_CONFLICTS
           
static int DENIED
           
static String GROUP_CAN_READ_EVENTS_FROM_OTHERS
           
static String GROUP_CATEGORY_KEY
           
static String GROUP_MODIFY_PREFERENCES_KEY
           
static String GROUP_REGISTERER_KEY
           
static Permission[] PERMISSION_ARRAY
          Static empty dummy Array.
static int READ
           
 
Method Summary
 boolean affectsUser(User user)
          returns if the user or a group of the user is affected by the permission.
 boolean covers(Date start, Date end, Date currentDate)
          returns if the permission covers the interval specified by the start and end date.
 int getAccessLevel()
           
 Date getEnd()
           
 Category getGroup()
           
 Long getMaxAdvance()
           
 Date getMaxAllowed(Date today)
          Convenince Method: returns the last date for which the resource can be booked
 Long getMinAdvance()
           
 Date getMinAllowed(Date today)
          Convenince Method: returns the first date for which the resource can be booked
 Date getStart()
           
 User getUser()
           
 void setAccessLevel(int access)
           
 void setEnd(Date end)
          sets the endtime of the period in which the resource can be booked
 void setGroup(Category category)
          sets a group for the permission.
 void setMaxAdvance(Long days)
          set the maximum number of days a reservation can be booked in advance.
 void setMinAdvance(Long days)
          set the minumum number of days a resource must be booked in advance.
 void setStart(Date end)
          sets the starttime of the period in which the resource can be booked
 void setUser(User user)
          sets a user for the permission.
 

Field Detail

GROUP_CATEGORY_KEY

static final String GROUP_CATEGORY_KEY
See Also:
Constant Field Values

GROUP_REGISTERER_KEY

static final String GROUP_REGISTERER_KEY
See Also:
Constant Field Values

GROUP_MODIFY_PREFERENCES_KEY

static final String GROUP_MODIFY_PREFERENCES_KEY
See Also:
Constant Field Values

GROUP_CAN_READ_EVENTS_FROM_OTHERS

static final String GROUP_CAN_READ_EVENTS_FROM_OTHERS
See Also:
Constant Field Values

DENIED

static final int DENIED
See Also:
Constant Field Values

READ

static final int READ
See Also:
Constant Field Values

ALLOCATE

static final int ALLOCATE
See Also:
Constant Field Values

ALLOCATE_CONFLICTS

static final int ALLOCATE_CONFLICTS
See Also:
Constant Field Values

ADMIN

static final int ADMIN
See Also:
Constant Field Values

ACCESS_LEVEL_NAMES

static final String[] ACCESS_LEVEL_NAMES

ACCESS_LEVEL_TYPES

static final int[] ACCESS_LEVEL_TYPES

ACCESS_LEVEL_NAMEMAP

static final SmallIntMap ACCESS_LEVEL_NAMEMAP

PERMISSION_ARRAY

static final Permission[] PERMISSION_ARRAY
Static empty dummy Array. Mainly for using the toArray() method of the collection interface

Method Detail

setUser

void setUser(User user)
sets a user for the permission. If a user is not null, the group will be set to null.


getUser

User getUser()

setGroup

void setGroup(Category category)
sets a group for the permission. If the group ist not null, the user will be set to null.


getGroup

Category getGroup()

setMinAdvance

void setMinAdvance(Long days)
set the minumum number of days a resource must be booked in advance. If days is null, a reservation can be booked anytime. Example: If you set days to 7, a resource must be allocated 7 days before its acutual use


getMinAdvance

Long getMinAdvance()

setMaxAdvance

void setMaxAdvance(Long days)
set the maximum number of days a reservation can be booked in advance. If days is null, a reservation can be booked anytime. Example: If you set days to 7, a resource can only be for the next 7 days.


getMaxAdvance

Long getMaxAdvance()

setStart

void setStart(Date end)
sets the starttime of the period in which the resource can be booked


getStart

Date getStart()

setEnd

void setEnd(Date end)
sets the endtime of the period in which the resource can be booked


getEnd

Date getEnd()

getMaxAllowed

Date getMaxAllowed(Date today)
Convenince Method: returns the last date for which the resource can be booked


getMinAllowed

Date getMinAllowed(Date today)
Convenince Method: returns the first date for which the resource can be booked


affectsUser

boolean affectsUser(User user)
returns if the user or a group of the user is affected by the permission. Groups are hierarchical. If the user belongs to a subgroup of the permission-group the user is also affected by the permission.


covers

boolean covers(Date start,
               Date end,
               Date currentDate)
returns if the permission covers the interval specified by the start and end date. The current date must be passed to calculate the permissable interval from minAdvance and maxAdvance.


setAccessLevel

void setAccessLevel(int access)

getAccessLevel

int getAccessLevel()


Copyright © 2000-2006 Rapla Team. All Rights Reseserved.