Class ProjectPlanPermissionsResource
java.lang.Object
com.atlassian.bamboo.plugins.rest.permission.ProjectPlanPermissionsResource
- All Implemented Interfaces:
PermissionsResource
@Path("permissions/projectplan")
@Produces("application/json")
@Consumes("application/json")
public class ProjectPlanPermissionsResource
extends Object
implements PermissionsResource
REST endpoint to manage user/group project plan permissions in Bamboo. Project plan permission is permission
applied on project and defines base permissions for plans in that project. Additional permission for given plans
can be applied on a plan level.
- 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 projectKey, String group, List<BambooPermission> permissionsToAdd) boolean
addLoggedInPermissions
(String projectKey, List<BambooPermission> permissionsToAdd) javax.ws.rs.core.Response
addPermissionsForGroup
(String projectKey, 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 projectKey, 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 projectKey, 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 projectKey, String username, List<BambooPermission> permissionsToAdd) getAnonymousPermissions
(String projectKey) getAvailableGroups
(String projectKey, 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 projectKey, 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 projectKey, String group) getLoggedInPermissions
(String projectKey) getUserPermissions
(String projectKey, String username) default boolean
isPermissionVisible
(@NotNull BambooPermission permission) listGroupPermissions
(String projectKey, String nameFilter, PageRequest pageRequest, ExpansionParam expansion, javax.ws.rs.core.UriInfo uriInfo) Returns a paged list of groupsRestGroupPermission
with non empty permissionslistGroupsWithPermissions
(String projectKey) listRolePermissions
(String projectKey, PageRequest pageRequest, ExpansionParam expansion, javax.ws.rs.core.UriInfo uriInfo) Returns a paged list of rolesRestRolePermission
with non empty permissionslistUserPermissions
(String projectKey, String nameFilter, PageRequest pageRequest, ExpansionParam expansion, javax.ws.rs.core.UriInfo uriInfo) Returns a paged list of usersRestUserPermission
with non empty permissionslistUsersWithPermissions
(String projectKey) permissionDependencies
(@NotNull BambooPermission permission) boolean
boolean
removeGroupPermissions
(String projectKey, String group, List<BambooPermission> permissionsToRemove) boolean
removeLoggedInPermissions
(String projectKey, List<BambooPermission> permissionsToRemove) javax.ws.rs.core.Response
removePermissionsForGroup
(String projectKey, 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 projectKey, 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 projectKey, 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 projectKey, String username, List<BambooPermission> permissionsToRemove)
-
Method Details
-
listUserPermissions
@GET @Path("{key}/users") public RestPageModel<RestUserPermission> listUserPermissions(@PathParam("key") String projectKey, @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("{key}/users/{name : (.+)?}") public javax.ws.rs.core.Response addPermissionsForUser(@PathParam("key") String projectKey, @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("{key}/users/{name : (.+)?}") public javax.ws.rs.core.Response removePermissionsForUser(@PathParam("key") String projectKey, @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("{key}/available-users") public RestPageModel<RestUser> getAvailableUsers(@PathParam("key") String projectKey, @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("{key}/groups") public RestPageModel<RestGroupPermission> listGroupPermissions(@PathParam("key") String projectKey, @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("{key}/groups/{name : (.+)?}") public javax.ws.rs.core.Response addPermissionsForGroup(@PathParam("key") String projectKey, @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("{key}/groups/{name : (.+)?}") public javax.ws.rs.core.Response removePermissionsForGroup(@PathParam("key") String projectKey, @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("{key}/available-groups") public RestPageModel<RestGroup> getAvailableGroups(@PathParam("key") String projectKey, @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("{key}/roles") public RestPageModel<RestRolePermission> listRolePermissions(@PathParam("key") String projectKey, @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("{key}/roles/{name : (.+)?}") public javax.ws.rs.core.Response addPermissionsForRole(@PathParam("key") String projectKey, @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("{key}/roles/{name : (.+)?}") public javax.ws.rs.core.Response removePermissionsForRole(@PathParam("key") String projectKey, @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 projectKey, String username, List<BambooPermission> permissionsToAdd) -
removeUserPermissions
public boolean removeUserPermissions(String projectKey, String username, List<BambooPermission> permissionsToRemove) -
listGroupsWithPermissions
-
getGroupPermissions
-
addGroupPermissions
public boolean addGroupPermissions(String projectKey, String group, List<BambooPermission> permissionsToAdd) -
removeGroupPermissions
public boolean removeGroupPermissions(String projectKey, String group, List<BambooPermission> permissionsToRemove) -
getLoggedInPermissions
-
addLoggedInPermissions
-
removeLoggedInPermissions
public boolean removeLoggedInPermissions(String projectKey, List<BambooPermission> permissionsToRemove) -
getAnonymousPermissions
-
addAnonymousPermissions
-
removeAnonymousPermissions
-
isPermissionVisible
-