Class ContentPermission
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.AnnotatedEntityObject
com.atlassian.confluence.core.ConfluenceEntityObject
com.atlassian.confluence.security.ContentPermission
- All Implemented Interfaces:
Serializable,Cloneable,Comparable<ContentPermission>
- Direct Known Subclasses:
NeverPermittedContentPermission
public class ContentPermission
extends ConfluenceEntityObject
implements Comparable<ContentPermission>
Allows a user to lock content against editing and/or viewing by other users.
This is a DB-level entity (see
com/atlassian/confluence/security/ContentPermission.hbm.xml).
Directly corresponding equivalent for ServiceLayer would be ContentRestriction
Each Content has as many ContentPermissionSets linked as there are operations restricted for the content.
Each ContentPermissionSet has as many ContentPermissions as there are specific users and/or groups to whom corresponding operations are restricted.
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionThis has to be public because theReflectiveObjectPersisterrequires public default constructors.Copy constructor.protectedContentPermission(String type, String groupName, ConfluenceUser user) protectedContentPermission(String type, String groupName, String userName) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionintcompareTo(ContentPermission that) static ContentPermissioncreateGroupPermission(String type, String groupName) static ContentPermissioncreateUserPermission(String type, ConfluenceUser user) static ContentPermissioncreateUserPermission(String type, String userName) Deprecated.since 5.2.booleangetType()Deprecated.since 5.2.WhenisUserPermission()is true, returns the user who is explicitly permitted by this permission.inthashCode()booleanbooleanisPermitted(com.atlassian.user.User user) Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useContentPermissionManagerbooleanbooleanisValid()voidsetOwningSet(ContentPermissionSet owningSet) voidsetSubject(ConfluenceUser subject) toString()Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setLastModifierMethods inherited from class com.atlassian.confluence.core.AnnotatedEntityObject
getCreationDate, getLastModificationDateMethods inherited from class com.atlassian.core.bean.EntityObject
clone, getCurrentDate, getId, setClock, setCreationDate, setId, setLastModificationDate
-
Field Details
-
VIEW_PERMISSION
- See Also:
-
EDIT_PERMISSION
- See Also:
-
SHARED_PERMISSION
- See Also:
-
EXPORT_PERMISSION
- See Also:
-
-
Constructor Details
-
ContentPermission
public ContentPermission()This has to be public because theReflectiveObjectPersisterrequires public default constructors. -
ContentPermission
Copy constructor. Does not copy the owning set.- Since:
- 4.0
-
ContentPermission
Deprecated.- Parameters:
type-groupName-userName-
-
ContentPermission
-
-
Method Details
-
createUserPermission
Deprecated. -
createUserPermission
-
createGroupPermission
-
isPermitted
Deprecated, for removal: This API element is subject to removal in a future version.since 9.3 useContentPermissionManagerDetermine 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()- Since:
- 9.2.6
-
isGroupPermission
public boolean isGroupPermission() -
isUserPermission
public boolean isUserPermission() -
getType
-
getUserName
Deprecated.since 5.2. UsegetUserSubject()instead. -
setSubject
- Since:
- 5.2
-
getUserSubject
WhenisUserPermission()is true, returns the user who is explicitly permitted by this permission.- Since:
- 5.2
-
getGroupName
-
getOwningSet
-
setOwningSet
-
compareTo
- Specified by:
compareToin interfaceComparable<ContentPermission>
-
toString
-
equals
- Overrides:
equalsin classcom.atlassian.core.bean.EntityObject
-
hashCode
public int hashCode()- Overrides:
hashCodein classcom.atlassian.core.bean.EntityObject
-
ContentPermission(String, String, com.atlassian.confluence.user.ConfluenceUser)