de.fh_mannheim.mm.dms.framework
Class Accesstype

java.lang.Object
  extended byde.fh_mannheim.mm.dms.framework.Accesstype
All Implemented Interfaces:
IElement, java.io.Serializable

public class Accesstype
extends java.lang.Object
implements IElement, java.io.Serializable

This class gives a representation of the accesstype of a specific user.

Version:
$Revision: 1.15 $
Author:
Jan Löffler, mail@jlsoft.de
See Also:
Serialized Form

Field Summary
static int ACCESSTYPE_COUNT
           
static int FULL
          Full rights to do everything.
static int GUEST
          Guest may only view.
static int NONE
          User has no right to start the program.
static int READ
          Users may only view and bookmark.
static int WRITE
          Rights to edit and add new uploads.
 
Constructor Summary
Accesstype(int nAccesstype)
          Constructor.
 
Method Summary
 boolean equals(java.lang.Object other)
          Compares two Accesstype objects.
static int getAccesstype(java.lang.String strAccesstype)
          Convert the accesstype to int.
static java.lang.String getAccesstypeText(int nAccesstype)
          Convert the accesstype to string.
 boolean hasFullRights()
          Check if accesstype has admin-rights.
 boolean hasGuestRights()
          Check if accesstype has rights to read.
 boolean hasLessRightsThan(Accesstype other)
          Compares two Accesstype objects if less.
 boolean hasMoreRightsThan(Accesstype other)
          Compares two Accesstype objects if more.
 boolean hasReadRights()
          Check if accesstype has rights to read.
 boolean hasWriteRights()
          Check if accesstype has rights to Add, Remove an Edit.
 org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
          Write information of accesstype in a xml element.
 org.w3c.dom.Element toElement(org.w3c.dom.Element element, org.w3c.dom.Document doc)
          Write information of accesstype in a xml element.
 int toInt()
          Convert the accesstype to int.
 java.lang.String toString()
          Convert the accesstype to string.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NONE

public static final int NONE
User has no right to start the program.

See Also:
Constant Field Values

GUEST

public static final int GUEST
Guest may only view.

See Also:
Constant Field Values

READ

public static final int READ
Users may only view and bookmark.

See Also:
Constant Field Values

WRITE

public static final int WRITE
Rights to edit and add new uploads.

See Also:
Constant Field Values

FULL

public static final int FULL
Full rights to do everything.

See Also:
Constant Field Values

ACCESSTYPE_COUNT

public static final int ACCESSTYPE_COUNT
See Also:
Constant Field Values
Constructor Detail

Accesstype

public Accesstype(int nAccesstype)
Constructor.

Parameters:
nAccesstype - Pre-selected accesstype
Method Detail

getAccesstypeText

public static java.lang.String getAccesstypeText(int nAccesstype)
Convert the accesstype to string.

Parameters:
nAccesstype - Accesstype
Returns:
Name of accesstype as string

getAccesstype

public static int getAccesstype(java.lang.String strAccesstype)
Convert the accesstype to int.

Parameters:
strAccesstype - Accesstype as string
Returns:
id of accesstype as int

equals

public boolean equals(java.lang.Object other)
Compares two Accesstype objects.

Parameters:
other - Accesstype to compare
Returns:
true, if equal

hasFullRights

public boolean hasFullRights()
Check if accesstype has admin-rights.

Returns:
true, if allowed to do everything

hasLessRightsThan

public boolean hasLessRightsThan(Accesstype other)
Compares two Accesstype objects if less.

Parameters:
other - Accesstype to compare
Returns:
true, if less

hasMoreRightsThan

public boolean hasMoreRightsThan(Accesstype other)
Compares two Accesstype objects if more.

Parameters:
other - Accesstype to compare
Returns:
true, if more

hasGuestRights

public boolean hasGuestRights()
Check if accesstype has rights to read.

Returns:
true, if allowed to read

hasReadRights

public boolean hasReadRights()
Check if accesstype has rights to read.

Returns:
true, if allowed to read

hasWriteRights

public boolean hasWriteRights()
Check if accesstype has rights to Add, Remove an Edit.

Returns:
true, if allowed to write

toInt

public int toInt()
Convert the accesstype to int.

Returns:
int-value of accesstype

toString

public java.lang.String toString()
Convert the accesstype to string.

Specified by:
toString in interface IElement
Returns:
name of accesstype as string

toElement

public org.w3c.dom.Element toElement(org.w3c.dom.Document doc)
Write information of accesstype in a xml element.

Specified by:
toElement in interface IElement
Parameters:
doc - XML Document
Returns:
element

toElement

public org.w3c.dom.Element toElement(org.w3c.dom.Element element,
                                     org.w3c.dom.Document doc)
Write information of accesstype in a xml element.

Specified by:
toElement in interface IElement
Parameters:
element - Root element
doc - XML Document
Returns:
element