com.flexive.shared.security
Class UserGroup

java.lang.Object
  extended by com.flexive.shared.AbstractSelectableObjectWithName
      extended by com.flexive.shared.security.UserGroup
All Implemented Interfaces:
ObjectWithColor, SelectableObject, SelectableObjectWithName, java.io.Serializable

public class UserGroup
extends AbstractSelectableObjectWithName
implements java.io.Serializable, ObjectWithColor

A group of users

Author:
Markus Plesser (markus.plesser@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at), Daniel Lichtenberger (daniel.lichtenberger@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at), Gregor Schober (gregor.schober@flexive.com), UCS - unique computing solutions gmbh (http://www.ucs.at)
See Also:
Serialized Form

Field Summary
static long GROUP_EVERYONE
          Group in which every user is in (including USER_GUEST).
static long GROUP_NULL
          Dummy group (Id if a null value cannot be applied)
static long GROUP_OWNER
          Group for special ACL permissions.
static long GROUP_UNDEFINED
          Undefined group
 
Constructor Summary
UserGroup(long id, long mandator, long autoMandator, boolean system, java.lang.String name, java.lang.String color)
          Ctor
UserGroup(long id, java.lang.String name, long mandator, java.lang.String color)
          Ctor
 
Method Summary
 long getAutoMandator()
          Get the id of the mandator this group is maintained for if it is a system group, else -1
 java.lang.String getColor()
          Getter for the displayed color
 long getId()
          Getter for the group id
 long getMandatorId()
          Getter for the mandator id
 java.lang.String getName()
          Getter for the name
 boolean isSystem()
          Is this an auto generated system group?
 boolean mayAccessGroup(UserTicket ticket)
          Returns true if the caller may see the group and its roles and assignments.
 void setColor(java.lang.String color)
          Setter for the color
 void setName(java.lang.String name)
          Setter for the name
 java.lang.String toString()
          
 
Methods inherited from class com.flexive.shared.AbstractSelectableObjectWithName
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

GROUP_UNDEFINED

public static final long GROUP_UNDEFINED
Undefined group

See Also:
Constant Field Values

GROUP_EVERYONE

public static final long GROUP_EVERYONE
Group in which every user is in (including USER_GUEST). This group may not be assigned to users.

See Also:
Constant Field Values

GROUP_OWNER

public static final long GROUP_OWNER
Group for special ACL permissions. This group may not be assigned to roles. A ACLAssignment using this group defines that its permissions are granted to the CREATOR of an object, not to the users within the GROUP_OWNER.

See Also:
Constant Field Values

GROUP_NULL

public static final long GROUP_NULL
Dummy group (Id if a null value cannot be applied)

See Also:
Constant Field Values
Constructor Detail

UserGroup

public UserGroup(long id,
                 java.lang.String name,
                 long mandator,
                 java.lang.String color)
Ctor

Parameters:
id - id
name - name
mandator - mandator id
color - color

UserGroup

public UserGroup(long id,
                 long mandator,
                 long autoMandator,
                 boolean system,
                 java.lang.String name,
                 java.lang.String color)
Ctor

Parameters:
id - id
mandator - mandator id
autoMandator - mandator id for auto generated system groups only, else -1
system - is this an auto generated system group?
name - name of the group
color - color
Method Detail

getId

public long getId()
Getter for the group id

Specified by:
getId in interface SelectableObject
Returns:
group id

getMandatorId

public long getMandatorId()
Getter for the mandator id

Returns:
mandator id

getAutoMandator

public long getAutoMandator()
Get the id of the mandator this group is maintained for if it is a system group, else -1

Returns:
id of the mandator this group is maintained for if it is a system group, else -1

isSystem

public boolean isSystem()
Is this an auto generated system group?

Returns:
auto generated system group?

getName

public java.lang.String getName()
Getter for the name

Specified by:
getName in interface SelectableObjectWithName
Returns:
name

getColor

public java.lang.String getColor()
Getter for the displayed color

Specified by:
getColor in interface ObjectWithColor
Returns:
color

setName

public void setName(java.lang.String name)
Setter for the name

Parameters:
name - group name

setColor

public void setColor(java.lang.String color)
Setter for the color

Parameters:
color - color

mayAccessGroup

public boolean mayAccessGroup(UserTicket ticket)
Returns true if the caller may see the group and its roles and assignments.

Parameters:
ticket - the caller
Returns:
true if the caller may see the group its roles and assignments

toString

public java.lang.String toString()

Overrides:
toString in class AbstractSelectableObjectWithName