com.atlassian.confluence.upgrade.security
Class LegacyContentPermission
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.ConfluenceEntityObject
com.atlassian.confluence.upgrade.security.LegacyContentPermission
- All Implemented Interfaces:
- Serializable, Cloneable
public class LegacyContentPermission
- extends ConfluenceEntityObject
This class represents the old form of ContentPermission. It exists solely for migration of data in the CONTENTLOCK
table over to the new CONTENT_PERM table.
- See Also:
LegacyContentPermissionUpgrader
,
Serialized Form
Methods inherited from class com.atlassian.core.bean.EntityObject |
clone, getCreationDate, getCurrentDate, getId, getLastModificationDate, setClock, setCreationDate, setId, setLastModificationDate |
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
LegacyContentPermission
public LegacyContentPermission(LegacyContentPermission cp)
LegacyContentPermission
public LegacyContentPermission()
LegacyContentPermission
public LegacyContentPermission(String type)
LegacyContentPermission
public LegacyContentPermission(String type,
String group)
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(com.atlassian.user.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.
isValid
public boolean isValid()
- Used in
LegacyContentPermissionUpgrader
- Returns:
- true if this contains a type and at least a creator name or group name
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 com.atlassian.core.bean.EntityObject
hashCode
public int hashCode()
- Overrides:
hashCode
in class com.atlassian.core.bean.EntityObject
setUserAccessor
public void setUserAccessor(UserAccessor userAccessor)
getUserAccessor
public UserAccessor getUserAccessor()
toContentPermission
public ContentPermission toContentPermission()
- Create a ContentPermission to represent this LegacyContentPermission. This is used for migration.
- See Also:
LegacyContentPermissionUpgrader
toString
public String toString()
- Overrides:
toString
in class Object