com.atlassian.confluence.security
Class ContentPermission

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

public class ContentPermission
extends ConfluenceEntityObject
implements Comparable

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()
          This has to be public because the com.atlassian.confluence.importexport.xmlimport.legacy.ReverseDatabinder requires public default constructors.
  ContentPermission(ContentPermission other)
          Copy constructor.
protected ContentPermission(String type, String groupName, String userName)
           
 
Method Summary
 int compareTo(Object o)
           
static ContentPermission createGroupPermission(String type, String groupName)
           
static ContentPermission createUserPermission(String type, String userName)
           
 boolean equals(Object o)
           
 String getGroup()
          Deprecated. as of version 2.4. Use getGroupName() instead.
 String getGroupName()
           
 ContentPermissionSet getOwningSet()
           
 String getType()
           
 String getUserName()
          When isUserPermission() is true, returns the username of the user who is explicitly permitted by this permission.
 int hashCode()
           
 boolean isGroupPermission()
           
 boolean isPermitted(com.atlassian.user.User user)
          Determine if a user is locked out by the permission.
 boolean isUserPermission()
           
 void setOwningSet(ContentPermissionSet owningSet)
           
 void setUserAccessor(UserAccessor userAccessor)
           
 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

ContentPermission

public ContentPermission()
This has to be public because the com.atlassian.confluence.importexport.xmlimport.legacy.ReverseDatabinder requires public default constructors.


ContentPermission

public ContentPermission(ContentPermission other)
Copy constructor. Does not copy the owning set.

Since:
4.0

ContentPermission

protected ContentPermission(String type,
                            String groupName,
                            String userName)
Method Detail

createUserPermission

public static ContentPermission createUserPermission(String type,
                                                     String userName)

createGroupPermission

public static ContentPermission createGroupPermission(String type,
                                                      String groupName)

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.

isGroupPermission

public boolean isGroupPermission()

isUserPermission

public boolean isUserPermission()

getType

public String getType()

getUserName

public String getUserName()
When isUserPermission() is true, returns the username of the user who is explicitly permitted by this permission.


setUserAccessor

public void setUserAccessor(UserAccessor userAccessor)

getGroupName

public String getGroupName()

getGroup

public String getGroup()
Deprecated. as of version 2.4. Use getGroupName() instead.


getOwningSet

public ContentPermissionSet getOwningSet()

setOwningSet

public void setOwningSet(ContentPermissionSet owningSet)

compareTo

public int compareTo(Object o)
Specified by:
compareTo in interface Comparable

toString

public String toString()
Overrides:
toString in class Object

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


Copyright © 2003-2011 Atlassian. All Rights Reserved.