org.itracker.model
Class Permission

java.lang.Object
  extended by org.itracker.model.AbstractEntity
      extended by org.itracker.model.Permission
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Entity>, Entity

public class Permission
extends AbstractEntity

A user permission on a project.

The permission type tells what kind of action the user is allowed perform.

Author:
ready
See Also:
Serialized Form

Nested Class Summary
static class Permission.PermissionPropertiesComparator
           
 
Nested classes/interfaces inherited from class org.itracker.model.AbstractEntity
AbstractEntity.CreateDateComparator, AbstractEntity.IdComparator, AbstractEntity.LastModifiedDateComparator
 
Field Summary
static Permission.PermissionPropertiesComparator PERMISSION_PROPERTIES_COMPARATOR
          Comparator for comparing the main properties type, user, project
 
Fields inherited from class org.itracker.model.AbstractEntity
CREATE_DATE_COMPARATOR, ID_COMPARATOR, LAST_MODIFIED_DATE_COMPARATOR
 
Constructor Summary
Permission()
          Default constructor (required by Hibernate).
Permission(Integer type, User user)
          Grants permissions on all projects to the given user.
Permission(Integer type, User user, Project project)
          Grants permissions on all projects to the given user.
 
Method Summary
 Integer getPermissionType()
           
 Project getProject()
           
 User getUser()
           
 void setPermissionType(Integer type)
           
 void setProject(Project project)
          May be null to indicate a permission on all projects.
 void setUser(User user)
           
 String toString()
           
 
Methods inherited from class org.itracker.model.AbstractEntity
clone, compareTo, equals, getCreateDate, getId, getLastModifiedDate, hashCode, isNew, setCreateDate, setId, setLastModifiedDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PERMISSION_PROPERTIES_COMPARATOR

public static final Permission.PermissionPropertiesComparator PERMISSION_PROPERTIES_COMPARATOR
Comparator for comparing the main properties type, user, project

Constructor Detail

Permission

public Permission()
Default constructor (required by Hibernate).

PENDING: should be private so that it can only be used by Hibernate, to ensure that the fields which form an instance's identity are always initialized/never null.


Permission

public Permission(Integer type,
                  User user)
Grants permissions on all projects to the given user.

Parameters:
type - permission type
user - grantee

Permission

public Permission(Integer type,
                  User user,
                  Project project)
Grants permissions on all projects to the given user.

Parameters:
type - permission type
user - grantee
project - on which permission is granted, or null for all projects
Method Detail

getPermissionType

public Integer getPermissionType()

setPermissionType

public void setPermissionType(Integer type)

getUser

public User getUser()

setUser

public void setUser(User user)

getProject

public Project getProject()

setProject

public void setProject(Project project)
May be null to indicate a permission on all projects.


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2002-2012 itracker. All Rights Reserved.