com.atlassian.confluence.core
Class ContentPermission

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.core.ConfluenceEntityObject
          extended by com.atlassian.confluence.core.ContentPermission
All Implemented Interfaces:
Serializable, Cloneable

public class ContentPermission
extends ConfluenceEntityObject

Allows a user to lock content against editing by other users.

Note: the expiry field is currently unused.

See Also:
Serialized Form

Field Summary
static String EDIT_PERMISSION
           
static String VIEW_PERMISSION
           
 
Constructor Summary
ContentPermission()
           
ContentPermission(ContentPermission cp)
           
ContentPermission(String type)
           
ContentPermission(String type, String group)
           
 
Method Summary
 boolean equals(Object o)
           
 String getComment()
           
 ContentEntityObject getContent()
           
 Date getExpiry()
           
 String getGroup()
           
 String getType()
           
 UserAccessor getUserAccessor()
           
 int hashCode()
           
 boolean isGroupPermission()
           
 boolean isPermitted(User user)
          Determine if a user is locked out by the permission.
 boolean isUserPermission()
           
 void setComment(String comment)
           
 void setContent(ContentEntityObject content)
           
 void setExpiry(Date expiry)
           
 void setGroup(String group)
           
 void setType(String type)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreatorName, getLastModifierName, isPersistent, setCreatorName, setLastModifierName
 
Methods inherited from class com.atlassian.core.bean.EntityObject
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

VIEW_PERMISSION

public static final String VIEW_PERMISSION
See Also:
Constant Field Values

EDIT_PERMISSION

public static final String EDIT_PERMISSION
See Also:
Constant Field Values
Constructor Detail

ContentPermission

public ContentPermission(ContentPermission cp)

ContentPermission

public ContentPermission()

ContentPermission

public ContentPermission(String type)

ContentPermission

public ContentPermission(String type,
                         String group)
Method Detail

getType

public String getType()

setType

public void setType(String type)

getGroup

public String getGroup()

setGroup

public void setGroup(String group)

getExpiry

public Date getExpiry()

setExpiry

public void setExpiry(Date expiry)

getContent

public ContentEntityObject getContent()

setContent

public void setContent(ContentEntityObject content)

isPermitted

public boolean isPermitted(User user)
Determine if a user is locked out by the permission. Note, this does not take into account if the user has a general ability to override a lock (say if they are a global or space-level administrator), lock overrides must be dealt with at a higher level. content level permissions cannot be granted to anonymous users

Parameters:
user - the user to test against
Returns:
true if the lock would prevent the user from editing content, false otherwise.

isGroupPermission

public boolean isGroupPermission()

isUserPermission

public boolean isUserPermission()

getComment

public String getComment()

setComment

public void setComment(String comment)

equals

public boolean equals(Object o)
Overrides:
equals in class EntityObject

hashCode

public int hashCode()
Overrides:
hashCode in class EntityObject

setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)

getUserAccessor

public UserAccessor getUserAccessor()


Confluence is developed by Atlassian.