Class RepositoryPermissionsResource
java.lang.Object
com.atlassian.bamboo.plugins.rest.permission.RepositoryPermissionsResource
- All Implemented Interfaces:
PermissionsResource
@Path("permissions/repository")
@Produces("application/json")
@Consumes("application/json")
public class RepositoryPermissionsResource
extends Object
implements PermissionsResource
REST endpoint to manage user/group repository permissions in Bamboo.
- Since:
- 6.2
-
Field Summary
Fields inherited from interface com.atlassian.bamboo.plugins.rest.permission.PermissionsResource
ROLE_ANONYMOUS, ROLE_LOGGED_IN
-
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
addGroupPermissions
(String id, String group, List<BambooPermission> permissionsToAdd) boolean
addLoggedInPermissions
(String id, List<BambooPermission> permissionsToAdd) javax.ws.rs.core.Response
addPermissionsForGroup
(String id, String group, List<String> permissionsToAdd) Adds given permissions to group Returns status code 204Response.Status.NO_CONTENT
if any permission was added or status code 304Response.Status.NOT_MODIFIED
if given permissions were already addedjavax.ws.rs.core.Response
addPermissionsForRole
(String id, String role, List<String> permissionsToAdd) Adds given permissions to role Returns status code 204Response.Status.NO_CONTENT
if any permission was added or status code 304Response.Status.NOT_MODIFIED
if all permissions were already addedjavax.ws.rs.core.Response
addPermissionsForUser
(String id, String username, List<String> permissionsToAdd) Adds given permissions to user Returns status code 204Response.Status.NO_CONTENT
if any permission was added or status code 304Response.Status.NOT_MODIFIED
if given permissions were already addedboolean
addUserPermissions
(String id, String username, List<BambooPermission> permissionsToAdd) getAnonymousPermissions
(String projectKey) getAvailableGroups
(String id, String nameFilter, PageRequest pageRequest, ExpansionParam expansion, javax.ws.rs.core.UriInfo uriInfo) Returns a paged list of groupsRestGroup
for which no permissions was defined.getAvailableUsers
(String id, String nameFilter, PageRequest pageRequest, ExpansionParam expansion, javax.ws.rs.core.UriInfo uriInfo) Returns a paged list of usersRestUser
for which no permissions was defined.getGroupPermissions
(String id, String group) getUserPermissions
(String id, String username) default boolean
isPermissionVisible
(@NotNull BambooPermission permission) listGroupPermissions
(String id, String nameFilter, PageRequest pageRequest, ExpansionParam expansion, javax.ws.rs.core.UriInfo uriInfo) Returns a paged list of groupsRestGroupPermission
with non empty permissionslistRolePermissions
(String id, PageRequest pageRequest, ExpansionParam expansion, javax.ws.rs.core.UriInfo uriInfo) Returns a paged list of rolesRestRolePermission
with non empty permissionslistUserPermissions
(String id, String nameFilter, PageRequest pageRequest, ExpansionParam expansion, javax.ws.rs.core.UriInfo uriInfo) Returns a paged list of usersRestUserPermission
with non empty permissionspermissionDependencies
(@NotNull BambooPermission permission) boolean
boolean
removeGroupPermissions
(String id, String group, List<BambooPermission> permissionsToRemove) boolean
removeLoggedInPermissions
(String id, List<BambooPermission> permissionsToRemove) javax.ws.rs.core.Response
removePermissionsForGroup
(String id, String group, List<String> permissionsToRemove) Removes given permissions from group Returns status code 204Response.Status.NO_CONTENT
if any permission was removed or status code 304Response.Status.NOT_MODIFIED
if given permissions were not presentjavax.ws.rs.core.Response
removePermissionsForRole
(String id, String role, List<String> permissionsToRemove) Removes given permissions from role Returns status code 204Response.Status.NO_CONTENT
if any permission was removed or status code 304Response.Status.NOT_MODIFIED
if given permissions were not presentjavax.ws.rs.core.Response
removePermissionsForUser
(String id, String username, List<String> permissionsToRemove) Removes given permissions from user Returns status code 204Response.Status.NO_CONTENT
if any permission was removed or status code 304Response.Status.NOT_MODIFIED
if given permissions were not presentboolean
removeUserPermissions
(String id, String username, List<BambooPermission> permissionsToRemove)
-
Method Details
-
listUserPermissions
@GET @Path("{id}/users") public RestPageModel<RestUserPermission> listUserPermissions(@PathParam("id") String id, @QueryParam("name") String nameFilter, @BeanParam PageRequest pageRequest, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) Description copied from interface:PermissionsResource
Returns a paged list of usersRestUserPermission
with non empty permissions- Specified by:
listUserPermissions
in interfacePermissionsResource
-
addPermissionsForUser
@PUT @Path("{id}/users/{name : (.+)?}") public javax.ws.rs.core.Response addPermissionsForUser(@PathParam("id") String id, @PathParam("name") String username, List<String> permissionsToAdd) Description copied from interface:PermissionsResource
Adds given permissions to user Returns status code 204Response.Status.NO_CONTENT
if any permission was added or status code 304Response.Status.NOT_MODIFIED
if given permissions were already added- Specified by:
addPermissionsForUser
in interfacePermissionsResource
-
removePermissionsForUser
@DELETE @Path("{id}/users/{name : (.+)?}") public javax.ws.rs.core.Response removePermissionsForUser(@PathParam("id") String id, @PathParam("name") String username, List<String> permissionsToRemove) Description copied from interface:PermissionsResource
Removes given permissions from user Returns status code 204Response.Status.NO_CONTENT
if any permission was removed or status code 304Response.Status.NOT_MODIFIED
if given permissions were not present- Specified by:
removePermissionsForUser
in interfacePermissionsResource
-
getAvailableUsers
@GET @Path("{id}/available-users") public RestPageModel<RestUser> getAvailableUsers(@PathParam("id") String id, @QueryParam("name") String nameFilter, @BeanParam PageRequest pageRequest, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) Description copied from interface:PermissionsResource
Returns a paged list of usersRestUser
for which no permissions was defined. Allows to filter by user name- Specified by:
getAvailableUsers
in interfacePermissionsResource
-
listGroupPermissions
@GET @Path("{id}/groups") public RestPageModel<RestGroupPermission> listGroupPermissions(@PathParam("id") String id, @QueryParam("name") String nameFilter, @BeanParam PageRequest pageRequest, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) Description copied from interface:PermissionsResource
Returns a paged list of groupsRestGroupPermission
with non empty permissions- Specified by:
listGroupPermissions
in interfacePermissionsResource
-
addPermissionsForGroup
@PUT @Path("{id}/groups/{name : (.+)?}") public javax.ws.rs.core.Response addPermissionsForGroup(@PathParam("id") String id, @PathParam("name") String group, List<String> permissionsToAdd) Description copied from interface:PermissionsResource
Adds given permissions to group Returns status code 204Response.Status.NO_CONTENT
if any permission was added or status code 304Response.Status.NOT_MODIFIED
if given permissions were already added- Specified by:
addPermissionsForGroup
in interfacePermissionsResource
-
removePermissionsForGroup
@DELETE @Path("{id}/groups/{name : (.+)?}") public javax.ws.rs.core.Response removePermissionsForGroup(@PathParam("id") String id, @PathParam("name") String group, List<String> permissionsToRemove) Description copied from interface:PermissionsResource
Removes given permissions from group Returns status code 204Response.Status.NO_CONTENT
if any permission was removed or status code 304Response.Status.NOT_MODIFIED
if given permissions were not present- Specified by:
removePermissionsForGroup
in interfacePermissionsResource
-
getAvailableGroups
@GET @Path("{id}/available-groups") public RestPageModel<RestGroup> getAvailableGroups(@PathParam("id") String id, @QueryParam("name") String nameFilter, @BeanParam PageRequest pageRequest, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) Description copied from interface:PermissionsResource
Returns a paged list of groupsRestGroup
for which no permissions was defined. Allows to filter by group name- Specified by:
getAvailableGroups
in interfacePermissionsResource
-
listRolePermissions
@GET @Path("{id}/roles") public RestPageModel<RestRolePermission> listRolePermissions(@PathParam("id") String id, @BeanParam PageRequest pageRequest, @BeanParam ExpansionParam expansion, @Context javax.ws.rs.core.UriInfo uriInfo) Description copied from interface:PermissionsResource
Returns a paged list of rolesRestRolePermission
with non empty permissions- Specified by:
listRolePermissions
in interfacePermissionsResource
-
addPermissionsForRole
@PUT @Path("{id}/roles/{name : (.+)?}") public javax.ws.rs.core.Response addPermissionsForRole(@PathParam("id") String id, @PathParam("name") String role, List<String> permissionsToAdd) Description copied from interface:PermissionsResource
Adds given permissions to role Returns status code 204Response.Status.NO_CONTENT
if any permission was added or status code 304Response.Status.NOT_MODIFIED
if all permissions were already added- Specified by:
addPermissionsForRole
in interfacePermissionsResource
-
removePermissionsForRole
@DELETE @Path("{id}/roles/{name : (.+)?}") public javax.ws.rs.core.Response removePermissionsForRole(@PathParam("id") String id, @PathParam("name") String role, List<String> permissionsToRemove) Description copied from interface:PermissionsResource
Removes given permissions from role Returns status code 204Response.Status.NO_CONTENT
if any permission was removed or status code 304Response.Status.NOT_MODIFIED
if given permissions were not present- Specified by:
removePermissionsForRole
in interfacePermissionsResource
-
supportedRoles
-
supportedPermissions
-
permissionDependencies
public Collection<BambooPermission> permissionDependencies(@NotNull @NotNull BambooPermission permission) -
listUsersWithPermissions
-
getUserPermissions
-
addUserPermissions
public boolean addUserPermissions(String id, String username, List<BambooPermission> permissionsToAdd) -
removeUserPermissions
public boolean removeUserPermissions(String id, String username, List<BambooPermission> permissionsToRemove) -
listGroupsWithPermissions
-
getGroupPermissions
-
addGroupPermissions
public boolean addGroupPermissions(String id, String group, List<BambooPermission> permissionsToAdd) -
removeGroupPermissions
public boolean removeGroupPermissions(String id, String group, List<BambooPermission> permissionsToRemove) -
getLoggedInPermissions
-
addLoggedInPermissions
-
removeLoggedInPermissions
-
getAnonymousPermissions
-
addAnonymousPermissions
-
removeAnonymousPermissions
-
isPermissionVisible
-