com.atlassian.confluence.upgrade.security
Class LegacyContentPermission

java.lang.Object
  extended by com.atlassian.core.bean.EntityObject
      extended by com.atlassian.confluence.core.ConfluenceEntityObject
          extended by 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

Field Summary
static String EDIT_PERMISSION
           
static String VIEW_PERMISSION
           
 
Constructor Summary
LegacyContentPermission()
           
LegacyContentPermission(LegacyContentPermission cp)
           
LegacyContentPermission(String type)
           
LegacyContentPermission(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(com.atlassian.user.User user)
          Determine if a user is locked out by the permission.
 boolean isUserPermission()
           
 boolean isValid()
          Used in LegacyContentPermissionUpgrader
 void setComment(String comment)
           
 void setContent(ContentEntityObject content)
           
 void setExpiry(Date expiry)
           
 void setGroup(String group)
           
 void setType(String type)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 ContentPermission toContentPermission()
          Create a ContentPermission to represent this LegacyContentPermission.
 String toString()
           
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreatorName, getLastModifierName, getRealClass, 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, 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

LegacyContentPermission

public LegacyContentPermission(LegacyContentPermission cp)

LegacyContentPermission

public LegacyContentPermission()

LegacyContentPermission

public LegacyContentPermission(String type)

LegacyContentPermission

public LegacyContentPermission(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(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


Copyright © 2003-2011 Atlassian. All Rights Reserved.