|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Ownable
An Ownable
item is an item which has a User
as its owner.
The OwnableUtil
class provides methods that includes data validation
to make it easy to implement this interface.
Reference implementation
public User getOwner() throws PermissionDeniedException, BaseException { return getDbControl().getItem(User.class, getData().getOwner()); } public void setOwner(User owner) throws PermissionDeniedException, InvalidDataException { checkPermission(Permission.SET_OWNER); OwnableUtil.setOwner(getData(), owner); }
OwnedItem
,
OwnableUtil
Method Summary | |
---|---|
User |
getOwner()
Get the User that is the owner of the item. |
boolean |
isOwner()
Check if the logged in user is the owner of this item or not. |
void |
setOwner(User owner)
Change the owner of the item. |
void |
takeOwnership()
Take ownership of the item. |
Methods inherited from interface net.sf.basedb.core.Identifiable |
---|
getId, getType, getVersion |
Methods inherited from interface net.sf.basedb.core.AccessControlled |
---|
checkPermission, getPermissions, hasPermission |
Method Detail |
---|
User getOwner() throws PermissionDeniedException, BaseException
User
that is the owner of the item.
PermissionDeniedException
- If the logged in user doesn't
have read permission to the owner
BaseException
- If there is another errorvoid setOwner(User owner) throws PermissionDeniedException, InvalidDataException
owner
- The new owner of the item
PermissionDeniedException
- If the logged in user doesn't
have permission to change the owner on the item
InvalidDataException
- If the owner is nulltakeOwnership()
void takeOwnership() throws PermissionDeniedException
PermissionDeniedException
- If the logged in user doesn't have
permission to take ownershipboolean isOwner()
|
2.17.2: 2011-06-17 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |