|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.core.BasicItem<GroupData>
org.proteios.core.Group
public class Group
This class is used to represent groups. Groups are used in the permission system to make it possible for a user to share items with other users.
Groups are intended to represent the actual organisation of a company/organisation. For example a top-level group "The company" may contain the sub-groups "Sales", "Marketing" and "Research". Individual users should be added to the sub-groups only.
Proteios comes with the predefined group Everyone, which
cannot contain any members, except that the permission system works as if
everyone is a member.
Role,
Project| Field Summary | |
|---|---|
static String |
EVERYONE
The id of the Everyone group where all users are (virtual) members. |
static Item |
TYPE
The type of item represented by this class. |
| Fields inherited from interface org.proteios.core.Nameable |
|---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
| Method Summary | |
|---|---|
void |
addGroup(Group group)
Add a group as a member to this group. |
void |
addUser(User user)
Add a user as a member to this group. |
String |
getDescription()
Get the description for the item. |
long |
getDiskUsage(QuotaType quotaType,
Location location)
Get the used number of bytes for the specified quota type and location. |
ItemQuery<Group> |
getGroups()
Get a query that returns the groups that are members of this group. |
String |
getName()
Get the name of the item. |
ItemQuery<Project> |
getProjects()
Get a query that returns the projects that this group is a member of. |
static ItemQuery<Group> |
getQuery()
Get a query configured to retrieve groups. |
Quota |
getQuota()
Get the Quota that applies to the group. |
String |
getSystemId()
Get the system id for the item. |
Item |
getType()
Get the type of item represented by the object. |
ItemQuery<User> |
getUsers()
Get a query that returns the users that are members of this group. |
boolean |
isMember(Group group)
Checks if a group is a member of this group. |
boolean |
isMember(User user)
Checks if a user is a member of this group. |
boolean |
isRemoved()
Check if the removed flag is set for this item. |
boolean |
isSystemItem()
Check if the item is a system item or not. |
boolean |
isUsed()
Checks if: A user has been assigned this group as a quota group There are also other items that can reference a group: DiscUsage Other groups ItemKeys Projects Users (as group members) The links to all these items are automatically deleted if the group is deleted and aren't included in this check. |
void |
removeGroup(Group group)
Remove a group that is a member of this group. |
void |
removeUser(User user)
Remove a user that is a member of this group. |
void |
setDescription(String description)
Set the description for the item. |
void |
setName(String name)
Set the name of the item. |
void |
setQuota(Quota quota)
Set the quota for the group. |
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
| Methods inherited from class org.proteios.core.BasicItem |
|---|
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.proteios.core.Identifiable |
|---|
getId, getVersion |
| Methods inherited from interface org.proteios.core.AccessControlled |
|---|
checkPermission, hasPermission |
| Field Detail |
|---|
public static final Item TYPE
Item.GROUP,
getType()public static final String EVERYONE
| Method Detail |
|---|
public static ItemQuery<Group> getQuery()
ItemQuery objectpublic Item getType()
IdentifiableItem enumeration.
getType in interface Identifiablepublic String getName()
Nameable
getName in interface NameableString with the name of the item
public void setName(String name)
throws PermissionDeniedException,
InvalidDataException
NameableNameable.MAX_NAME_LENGTH constant.
setName in interface Nameablename - The new name for the item
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH constantpublic String getDescription()
Nameable
getDescription in interface NameableString with a description of the item
public void setDescription(String description)
throws PermissionDeniedException,
InvalidDataException
NameableNameable.MAX_DESCRIPTION_LENGTH constant.
setDescription in interface Nameabledescription - The new description for the item
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH constantpublic boolean isRemoved()
Removable
isRemoved in interface Removable
public void setRemoved(boolean removed)
throws PermissionDeniedException
Removable
setRemoved in interface Removableremoved - TRUE if the item should be flagged as removed,
FALSE otherwise
PermissionDeniedException - If the logged in user doesn't
have Permission.DELETE permission for setting the flag
to TRUE or Permission.WRITE permission for setting the
flag to FALSEpublic String getSystemId()
SystemItem
getSystemId in interface SystemItempublic boolean isSystemItem()
SystemItem
isSystemItem in interface SystemItem
public boolean isUsed()
throws BaseException
isUsed in class BasicItem<GroupData>BaseException
public Quota getQuota()
throws PermissionDeniedException,
BaseException
Quota that applies to the group.
Quota item, or null if no quota has been
assigned to this group
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the item
BaseException
public void setQuota(Quota quota)
throws PermissionDeniedException,
InvalidDataException
quota - The new Quota, or null to disable quota for
this group
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission for the group or
Permission.USE permission for the quota
InvalidDataException - If the quota is null
public long getDiskUsage(QuotaType quotaType,
Location location)
throws BaseException
quotaType - The QuotaTypelocation - The location
BaseException
public void addUser(User user)
throws PermissionDeniedException,
InvalidDataException
EVERYONE group.
user - The user to add
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission for the group and
Permission.USE for the user
InvalidDataException - If the user is null
public void removeUser(User user)
throws PermissionDeniedException,
InvalidDataException
user - The user to remove
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission for the group and
Permission.USE for the user
InvalidDataException - If the user is nullpublic boolean isMember(User user)
user - The user to check
public ItemQuery<User> getUsers()
throws BaseException
BaseExceptionUser.getQuery()
public void addGroup(Group group)
throws PermissionDeniedException,
InvalidDataException
EVERYONE group.
group - The group to add
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission for both groups
InvalidDataException - If the group is null
public void removeGroup(Group group)
throws PermissionDeniedException,
InvalidDataException
group - The group to remove
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission for both groups
InvalidDataException - If the group is nullpublic boolean isMember(Group group)
group - The group to check
public ItemQuery<Group> getGroups()
getQuery()public ItemQuery<Project> getProjects()
Project.getQuery()
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||