Class GlobalPermissionResource
- java.lang.Object
-
- com.atlassian.bamboo.plugins.testutils.rest.resource.administration.GlobalPermissionResource
-
public class GlobalPermissionResource extends Object
REST endpoint to manage user/group permissions in bamboo.
-
-
Constructor Summary
Constructors Constructor Description GlobalPermissionResource(BambooPermissionManager bambooPermissionManager, HibernateMutableAclService aclService, com.atlassian.sal.api.message.I18nResolver i18nResolver, BambooUserManager userManager, AdministrationConfigurationAccessor administrationConfigurationAccessor, AdministrationConfigurationPersister administrationConfigurationPersister, GlobalPermissionsService globalPermissionsService)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description @NotNull List<RestGlobalPermission>
getGroupPermission(@Nullable String groupName, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Retrieve a list of groups with their permissions.@NotNull List<RestGlobalPermission>
getRolePermission(@Nullable String roleName, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Retrieve a list of roles with their permissions.@NotNull List<RestGlobalPermission>
getUserPermission(@Nullable String userName, @NotNull Expansion expansion, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Retrieve a list of users with their permissions.@NotNull RestGlobalPermission
updateGroupPermission(@Nullable RestGlobalPermission restGlobalPermission, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Update global permissions of a group.RestGlobalPermission
updateRolePermission(@Nullable RestGlobalPermission restGlobalPermission, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Update global permissions of a role.@NotNull RestGlobalPermission
updateUserPermission(@Nullable RestGlobalPermission restGlobalPermission, @NotNull javax.ws.rs.core.UriInfo uriInfo)
Update global permissions of a user.
-
-
-
Constructor Detail
-
GlobalPermissionResource
public GlobalPermissionResource(BambooPermissionManager bambooPermissionManager, HibernateMutableAclService aclService, com.atlassian.sal.api.message.I18nResolver i18nResolver, BambooUserManager userManager, AdministrationConfigurationAccessor administrationConfigurationAccessor, AdministrationConfigurationPersister administrationConfigurationPersister, GlobalPermissionsService globalPermissionsService)
-
-
Method Detail
-
getUserPermission
@NotNull public @NotNull List<RestGlobalPermission> getUserPermission(@Nullable @Nullable String userName, @NotNull @Context @NotNull Expansion expansion, @NotNull @Context @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Retrieve a list of users with their permissions. The list can be filtered by some attributes. Currently only user name (query parameter "name") is supported and is mandatory. Only one user will be included in the result.- Parameters:
userName
- user name- Returns:
- a list of user's permissions
- Throws:
WebValidationException
-
getGroupPermission
@NotNull public @NotNull List<RestGlobalPermission> getGroupPermission(@Nullable @Nullable String groupName, @NotNull @Context @NotNull Expansion expansion, @NotNull @Context @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Retrieve a list of groups with their permissions. The list can be filtered by some attributes. Currently Only group name is supported and is mandatory. Only one group will be included in the result. Group name is provided as a query parameter, e.g. http://bamboo/rest/backdoor/latest/permissions/roles?name=bamboo-admin- Parameters:
groupName
- Group name- Returns:
- A list of group permissions
- Throws:
WebValidationException
-
getRolePermission
@NotNull public @NotNull List<RestGlobalPermission> getRolePermission(@Nullable @Nullable String roleName, @NotNull @Context @NotNull Expansion expansion, @NotNull @Context @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Retrieve a list of roles with their permissions. The list can be filtered by some attributes. Currently Only role name is supported and is mandatory. Only one role will be included in the result. Only two roles are supported: ROLE_USER, the logged in user, and ROLE_ANONYMOUS, anonymous user. Role name is provided as a query parameter, e.g. http://bamboo/rest/backdoor/latest/permissions/roles?name=ROLE_USER- Parameters:
roleName
- name of the role- Returns:
- List of permissions
- Throws:
WebValidationException
-
updateUserPermission
@NotNull public @NotNull RestGlobalPermission updateUserPermission(@Nullable @Nullable RestGlobalPermission restGlobalPermission, @NotNull @Context @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Update global permissions of a user. Only Restricted/System Admins are allowed to invoke this REST endpoint. Restricted Admins cannot update any System Admin permissions. It also guarantees there's at lease one group or user has System Admin permission.- Parameters:
restGlobalPermission
- Permission model of the user- Returns:
- Updated permission model of the user
- Throws:
WebValidationException
-
updateGroupPermission
@NotNull public @NotNull RestGlobalPermission updateGroupPermission(@Nullable @Nullable RestGlobalPermission restGlobalPermission, @NotNull @Context @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Update global permissions of a group. Only Restricted/System Admins are allowed to invoke this REST endpoint. Restricted Admins cannot update any System Admin permissions. It also guarantees there's at lease one group or user has System Admin permission.- Parameters:
restGlobalPermission
- Permission model of the group- Returns:
- Updated permission model of the group
- Throws:
WebValidationException
-
updateRolePermission
public RestGlobalPermission updateRolePermission(@Nullable @Nullable RestGlobalPermission restGlobalPermission, @NotNull @Context @NotNull javax.ws.rs.core.UriInfo uriInfo) throws WebValidationException
Update global permissions of a role. Only Restricted/System Admins are allowed to invoke this REST endpoint. Only two roles are allowed to be updated: ROLE_USER, the logged in user, and ROLE_ANONYMOUS, anonymous user. Logged in users can only be granted READ, CREATE permission, anonymous users can only be granted READ permission.- Parameters:
restGlobalPermission
-uriInfo
-- Returns:
- Updated permission model of the role
- Throws:
WebValidationException
-
-