Class SpacePermission
java.lang.Object
com.atlassian.core.bean.EntityObject
com.atlassian.confluence.core.AnnotatedEntityObject
com.atlassian.confluence.core.ConfluenceEntityObject
com.atlassian.confluence.security.SpacePermission
- All Implemented Interfaces:
Serializable,Cloneable
A SpacePermission restricts access to different functions on a space. A a SpacePermission is defined for a
permissionType then that permissionType is not permitted, otherwise if it's not it's permitted.
- Version:
- $Revision: 1.41 $
- Author:
- $Author: sleberrigaud $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringA permission type to control whether a user can browse for users in the system, such as in user auto-completes or view profile information of other users.static final Stringstatic final StringPermission type to do anything in Confluence that can't affect the system on which it runs.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Collection<String>represents all permissions which can be used to build SpacePermissions.static final Collection<String>A list of all global permissionsstatic final Collection<String>A list of all permissions that can not be assigned to the anonymous userstatic final StringUsers can be granted unlicensed authenticated access (limited) to Confluence, by being assigned this permission.static final Collection<String>A list of all possible permissionsstatic final Stringstatic final Stringstatic final Collection<String>SpacePermissions implicitly granted when using an OAuth token with READ_ALL scope.static final Collection<String>SpacePermissions available when Read Only Mode is enabled.static final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringPermission type to do anything at all in Confluence.static final StringA permission type to control whether a user can update their user status.static final StringNote: this should no longer be checked directly, useConfluenceAccessManagerinstead.static final StringDeprecated.since 5.9.static final StringView content within the space, including pages, blogposts etc. -
Constructor Summary
ConstructorsConstructorDescriptionDeprecated.SpacePermission(SpacePermission spacePermission) Deprecated.SpacePermission(String type) Deprecated.SpacePermission(String type, @Nullable Space space, @Nullable String group, @Nullable ConfluenceUser subject) Deprecated.SpacePermission(String type, @Nullable Space space, @Nullable String group, @Nullable String userName) Deprecated.since 3.0, as passing both group and userName leads to an invalid permissionSpacePermission(String type, @Nullable Space space, String group) Deprecated.SpacePermission(String type, Space space) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionstatic SpacePermissioncreateAnonymousSpacePermission(String type, @Nullable Space space) static SpacePermissioncreateAuthenticatedUsersSpacePermission(String type, @Nullable Space space) Creates a permission which is granted to all authenticated users, including unlicensed users.static SpacePermissioncreateGroupSpacePermission(String type, @Nullable Space space, String group) static SpacePermissioncreateUserSpacePermission(String type, @Nullable Space space, ConfluenceUser subject) static SpacePermissioncreateUserSpacePermission(String type, @Nullable Space space, String userName) Deprecated.since 5.2.boolean@Nullable StringgetGroup()@Nullable SpacegetSpace()The space of this permission.longgetType()@Nullable StringDeprecated.since 5.2.@Nullable ConfluenceUserinthashCode()booleanbooleanbooleanisDependentOn(SpacePermission otherPermission) One permission is dependent on another if the other permission is a guard permission that applies to the same space/global scope, and to the same group / user / "all users" subject as this permission.booleanbooleanbooleanIs this a guard permission, either globally or at the space level? Guard permissions are required before any more permissions can be added for a particular user/group in a particular scope.booleanSome permissions are not valid as they can not be assigned to the anonymous user.booleanbooleanbooleanstatic booleanisValidAnonymousPermission(String permissionType) static booleanisValidAuthenticatedUsersPermission(String permissionType) protected voidsetAllUsersSubject(String storedValue) voidDeprecated.since 5.9.voidvoidDeprecated.since 5.9.voidsetUserName(String userName) Deprecated.since 5.2.voidsetUserSubject(@Nullable ConfluenceUser user) Deprecated.toFormParameterName(String parameterType) Deprecated.As of 2.7.2, usePermissionRow.buildParameterName(String, String).toString()Methods inherited from class com.atlassian.confluence.core.ConfluenceEntityObject
getCreator, getCreatorName, getLastModifier, getLastModifierName, getRealClass, isPersistent, setCreator, setCreatorName, setLastModifier, setLastModifierNameMethods 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
-
USE_CONFLUENCE_PERMISSION
Note: this should no longer be checked directly, useConfluenceAccessManagerinstead.- See Also:
-
LIMITED_USE_CONFLUENCE_PERMISSION
Users can be granted unlicensed authenticated access (limited) to Confluence, by being assigned this permission. Do not check this permission directly, useConfluenceAccessManagerOR annotations such asUnlicensedSiteAccessinstead.- Since:
- 5.9
- See Also:
-
UPDATE_USER_STATUS_PERMISSION
A permission type to control whether a user can update their user status.- See Also:
-
VIEW_USER_PROFILES_PERMISSION
Deprecated.since 5.9. UseBROWSE_USERS_PERMISSIONinstead.A permission type to control whether a user can view user profiles within the system. This only applies to the anonymous and unlicensed users.- See Also:
-
BROWSE_USERS_PERMISSION
A permission type to control whether a user can browse for users in the system, such as in user auto-completes or view profile information of other users. This currently only applies to the anonymous and unlicensed users, but may be expanded in future.- See Also:
-
SYSTEM_ADMINISTRATOR_PERMISSION
Permission type to do anything at all in Confluence. Users with this permission should be allowed to do virtually anything in Confluence. All actions should check for this permission.- See Also:
-
CONFLUENCE_ADMINISTRATOR_PERMISSION
Permission type to do anything in Confluence that can't affect the system on which it runs. Users with this permission should be allowed to perform most administration tasks but not install plugins or write macros.- See Also:
-
PERSONAL_SPACE_PERMISSION
- See Also:
-
CREATE_SPACE_PERMISSION
- See Also:
-
PROFILE_ATTACHMENT_PERMISSION
- See Also:
-
VIEWSPACE_PERMISSION
View content within the space, including pages, blogposts etc.- See Also:
-
REMOVE_OWN_CONTENT_PERMISSION
- See Also:
-
COMMENT_PERMISSION
- See Also:
-
CREATEEDIT_PAGE_PERMISSION
- See Also:
-
ADMINISTER_SPACE_PERMISSION
- See Also:
-
REMOVE_PAGE_PERMISSION
- See Also:
-
REMOVE_COMMENT_PERMISSION
- See Also:
-
REMOVE_BLOG_PERMISSION
- See Also:
-
CREATE_ATTACHMENT_PERMISSION
- See Also:
-
REMOVE_ATTACHMENT_PERMISSION
- See Also:
-
EDITBLOG_PERMISSION
- See Also:
-
EXPORT_SPACE_PERMISSION
- See Also:
-
REMOVE_MAIL_PERMISSION
- See Also:
-
SET_PAGE_PERMISSIONS_PERMISSION
- See Also:
-
PERMISSION_TYPES
A list of all possible permissions -
GENERIC_SPACE_PERMISSIONS
represents all permissions which can be used to build SpacePermissions. -
READ_ONLY_SPACE_PERMISSIONS
SpacePermissions available when Read Only Mode is enabled. -
READ_ALL_SCOPE_SPACE_PERMISSIONS
SpacePermissions implicitly granted when using an OAuth token with READ_ALL scope. -
GLOBAL_PERMISSIONS
A list of all global permissions -
INVALID_ANONYMOUS_PERMISSIONS
A list of all permissions that can not be assigned to the anonymous user
-
-
Constructor Details
-
SpacePermission
Deprecated. -
SpacePermission
Deprecated. -
SpacePermission
Deprecated. -
SpacePermission
Deprecated. -
SpacePermission
@Deprecated public SpacePermission(String type, @Nullable Space space, @Nullable String group, @Nullable String userName) Deprecated.since 3.0, as passing both group and userName leads to an invalid permission -
SpacePermission
@Deprecated public SpacePermission(String type, @Nullable Space space, @Nullable String group, @Nullable ConfluenceUser subject) Deprecated.- Since:
- 5.2
-
SpacePermission
Deprecated.Creates a new SpacePermission with the attributes of another. Does not copy the id, or otherConfluenceEntityObjectstate.- Parameters:
spacePermission- a spacePermission to replicate.
-
-
Method Details
-
getSpace
The space of this permission. -
setSpace
-
getSpaceId
public long getSpaceId() -
getType
-
setType
Deprecated.since 5.9. Use one of the factory methods such ascreateGroupSpacePermission(java.lang.String, com.atlassian.confluence.spaces.Space, java.lang.String)instead. -
getGroup
-
setGroup
Deprecated. -
getAllUsersSubject
-
setAllUsersSubject
-
getUserName
Deprecated.since 5.2. UsegetUserSubject()instead. -
setUserName
Deprecated.since 5.2. SeesetUserSubject(ConfluenceUser)instead. -
getUserSubject
- Since:
- 5.2
-
setUserSubject
Deprecated.- Since:
- 5.2
-
isUserPermission
@EnsuresNonNullIf(expression={"getUserSubject()","getUserName()"}, result=true) public boolean isUserPermission() -
isGroupPermission
@EnsuresNonNullIf(expression="getGroup()", result=true) public boolean isGroupPermission() -
isAnonymousPermission
public boolean isAnonymousPermission() -
isAuthenticatedUsersPermission
public boolean isAuthenticatedUsersPermission()- Since:
- 5.9
-
isGlobalPermission
@EnsuresNonNullIf(expression="getSpace()", result=false) public boolean isGlobalPermission() -
isSpacePermission
@EnsuresNonNullIf(expression="getSpace()", result=true) public boolean isSpacePermission() -
toString
-
equals
- Overrides:
equalsin classcom.atlassian.core.bean.EntityObject
-
hashCode
public int hashCode()- Overrides:
hashCodein classcom.atlassian.core.bean.EntityObject
-
toFormParameterName
Deprecated.As of 2.7.2, usePermissionRow.buildParameterName(String, String).Convert the space permission into a form parameter name that can be used for form checkboxes. The reverse of this method isPermissionsFormHandler.fromFormParameterName(java.lang.String, com.atlassian.confluence.spaces.Space, java.lang.String)The format of the parameter name is:
confluence_[parameterType]_[permissionType]_[user/group/anonymous]_[user/group name]Note: the space is NOT encoded in the form parameter name, and must be kept separately.
- Parameters:
parameterType- distinguishes the parameter from other parameters created with the same permission.- Returns:
- the space permission as a form parameter.
-
isGuardPermission
public boolean isGuardPermission()Is this a guard permission, either globally or at the space level? Guard permissions are required before any more permissions can be added for a particular user/group in a particular scope. Globally, USE_CONFLUENCE and LIMITED_USE_CONFLUENCE are guard permissions, at the space level, VIEWSPACE is the guard.- Returns:
- true if this is a guard permission, false otherwise.
-
isDependentOn
One permission is dependent on another if the other permission is a guard permission that applies to the same space/global scope, and to the same group / user / "all users" subject as this permission. It is used when determining which permissions should be removed as the result of removing a guard permission.- Parameters:
otherPermission- - permission to check against- Returns:
- true if this permission is dependent on otherPermission, false otherwise.
-
isInvalidAnonymousPermission
public boolean isInvalidAnonymousPermission()Some permissions are not valid as they can not be assigned to the anonymous user. Really, we should just refuse to create such permissions from the outset, but for now we've just got this check.- Returns:
- true if this permission is invalid due to being anonymous, and of a type not available to anonymous users
-
isValidAnonymousPermission
-
isInvalidAuthenticatedUsersPermission
public boolean isInvalidAuthenticatedUsersPermission()- Returns:
- true if this permission is for authenticated
-
isValidAuthenticatedUsersPermission
-
createAnonymousSpacePermission
-
createUserSpacePermission
@Deprecated public static SpacePermission createUserSpacePermission(String type, @Nullable Space space, String userName) Deprecated. -
createUserSpacePermission
public static SpacePermission createUserSpacePermission(String type, @Nullable Space space, ConfluenceUser subject) -
createGroupSpacePermission
public static SpacePermission createGroupSpacePermission(String type, @Nullable Space space, String group) -
createAuthenticatedUsersSpacePermission
public static SpacePermission createAuthenticatedUsersSpacePermission(String type, @Nullable Space space) Creates a permission which is granted to all authenticated users, including unlicensed users.
-