public class PermissionsResource extends Object
Preferred way to invoke this from tests: com.atlassian.confluence.test.rest.api.PermissionsRest in confluence-test-utils.
Legacy alternative way to invoke this: com.atlassian.confluence.it.rpc.delegates.admin.PermissionsRpc via com.atlassian.confluence.it.rpc.ConfluenceRpc.
Please maintain both of the above clients if modifying this class.
Permission requirements: must be sysadmin to call this.
TODO: update this to use api SpacePermissionService instead of SpacePermissionManager, once implemented.
Constructor and Description |
---|
PermissionsResource(SpacePermissionManager spacePermissionManager,
SpaceManager spaceManager,
UserAccessor userAccessor,
org.springframework.transaction.PlatformTransactionManager transactionManager) |
Modifier and Type | Method and Description |
---|---|
void |
changeGlobalPermissions(List<SubjectPermissionChange> permissionChanges)
Enable or disable one or more global permissions for one or more groups, users, or anonymous.
|
void |
changeGlobalUnlicensedAuthenticatedPermissions(List<PermissionChange> permissionChanges)
Enable or disable one or more global permissions for unlicensed authenticated users.
|
void |
changeSpacePermissions(String spaceKey,
List<SubjectPermissionChange> permissionChanges)
Enable or disable one or more space permissions for one or more groups, users, or anonymous.
|
void |
changeSpaceUnlicensedAuthenticatedPermissions(String spaceKey,
List<PermissionChange> permissionChanges)
Enable or disable one or more space permissions for unlicensed authenticated users.
|
void |
deprecatedChangeGlobalAnonymousPermission(String permission,
boolean enabled)
Deprecated.
Use
changeGlobalPermissions(java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>) instead.
This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed. |
void |
deprecatedChangeGlobalGroupPermission(String groupName,
String permission,
boolean enabled)
Deprecated.
Use
changeGlobalPermissions(java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>) instead, which better supports special characters in group
names. This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed. |
void |
deprecatedChangeGlobalUnlicensedAuthenticatedPermission(String permission,
boolean enabled)
Deprecated.
Use
changeGlobalUnlicensedAuthenticatedPermissions(java.util.List<com.atlassian.confluence.functest.rest.admin.model.PermissionChange>) instead.
This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed. |
void |
deprecatedChangeGlobalUserPermissionByUsername(String userName,
String permission,
boolean enabled)
Deprecated.
Use
changeGlobalPermissions(java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>) instead, which better supports special characters in user
names. This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed. |
void |
deprecatedChangeSpaceAnonymousPermission(String spaceKey,
String permission,
boolean enabled)
Deprecated.
Use
changeSpacePermissions(java.lang.String, java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>) instead.
This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed. |
void |
deprecatedChangeSpaceGroupPermission(String spaceKey,
String groupName,
String permission,
boolean enabled)
Deprecated.
Use
changeSpacePermissions(java.lang.String, java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>) instead, which better supports special characters in group
names. This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed. |
void |
deprecatedChangeSpaceUnlicensedAuthenticatedPermission(String spaceKey,
String permission,
boolean enabled)
Deprecated.
Use
changeSpaceUnlicensedAuthenticatedPermissions(java.lang.String, java.util.List<com.atlassian.confluence.functest.rest.admin.model.PermissionChange>) instead.
This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed. |
void |
deprecatedChangeSpaceUserPermissionByUsername(String spaceKey,
String userName,
String permission,
boolean enabled)
Deprecated.
Use
changeSpacePermissions(java.lang.String, java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>) instead, which better supports special characters in user
names. This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed. |
void |
revokeAllGlobalPermissions(Subject subject)
Revoke all global permissions for a group, user, or anonymous.
|
void |
revokeAllGlobalUnlicensedAuthenticatedPermissions()
Revoke all global permissions for unlicensed authenticated users.
|
void |
revokeAllSpacePermissions(String spaceKey,
Subject subject)
Revoke all permissions on a space for a user, group or anonymous.
|
void |
revokeAllSpaceUnlicensedAuthenticatedPermissions(String spaceKey)
Revoke all permissions on a space for unlicensed authenticated users.
|
public PermissionsResource(@Qualifier(value="spacePermissionManager") SpacePermissionManager spacePermissionManager, SpaceManager spaceManager, UserAccessor userAccessor, @Qualifier(value="transactionManager") org.springframework.transaction.PlatformTransactionManager transactionManager)
spacePermissionManager
- the top-level SpacePermissionManager: note this is wrapped with
SpacePermissionCoordinator, which does its own permission checks, but calling user has to be sysadmin anywaypublic void changeGlobalPermissions(List<SubjectPermissionChange> permissionChanges)
permissionChanges
- the changes to apply. Any permissions not specified will not be changed.public void revokeAllGlobalPermissions(Subject subject)
subject
- the subject whose global permissions should be revokedpublic void changeGlobalUnlicensedAuthenticatedPermissions(List<PermissionChange> permissionChanges)
permissionChanges
- the changes to apply. Any permissions not specified will not be changed.public void revokeAllGlobalUnlicensedAuthenticatedPermissions()
public void changeSpacePermissions(String spaceKey, List<SubjectPermissionChange> permissionChanges)
permissionChanges
- the changes to apply. Any permissions not specified will not be changed.public void revokeAllSpacePermissions(String spaceKey, Subject subject)
subject
- the subject whose global permissions should be revokedpublic void changeSpaceUnlicensedAuthenticatedPermissions(String spaceKey, List<PermissionChange> permissionChanges)
permissionChanges
- the changes to apply. Any permissions not specified will not be changed.public void revokeAllSpaceUnlicensedAuthenticatedPermissions(String spaceKey)
@Deprecated public void deprecatedChangeGlobalGroupPermission(String groupName, String permission, boolean enabled)
changeGlobalPermissions(java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>)
instead, which better supports special characters in group
names. This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed.@Deprecated public void deprecatedChangeGlobalUserPermissionByUsername(String userName, String permission, boolean enabled)
changeGlobalPermissions(java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>)
instead, which better supports special characters in user
names. This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed.@Deprecated public void deprecatedChangeGlobalUnlicensedAuthenticatedPermission(String permission, boolean enabled)
changeGlobalUnlicensedAuthenticatedPermissions(java.util.List<com.atlassian.confluence.functest.rest.admin.model.PermissionChange>)
instead.
This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed.@Deprecated public void deprecatedChangeGlobalAnonymousPermission(String permission, boolean enabled)
changeGlobalPermissions(java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>)
instead.
This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed.@Deprecated public void deprecatedChangeSpaceGroupPermission(String spaceKey, String groupName, String permission, boolean enabled)
changeSpacePermissions(java.lang.String, java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>)
instead, which better supports special characters in group
names. This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed.@Deprecated public void deprecatedChangeSpaceUserPermissionByUsername(String spaceKey, String userName, String permission, boolean enabled)
changeSpacePermissions(java.lang.String, java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>)
instead, which better supports special characters in user
names. This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed.@Deprecated public void deprecatedChangeSpaceUnlicensedAuthenticatedPermission(String spaceKey, String permission, boolean enabled)
changeSpaceUnlicensedAuthenticatedPermissions(java.lang.String, java.util.List<com.atlassian.confluence.functest.rest.admin.model.PermissionChange>)
instead.
This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed.@Deprecated public void deprecatedChangeSpaceAnonymousPermission(String spaceKey, String permission, boolean enabled)
changeSpacePermissions(java.lang.String, java.util.List<com.atlassian.confluence.functest.rest.admin.model.SubjectPermissionChange>)
instead.
This method is only here to support the tiny range of confluence-test-utils PermissionsRest versions that
called it, and can eventually be removed.Copyright © 2003–2016 Atlassian. All rights reserved.