Interface PermissionService
@Path("/security")
@Consumes({"application/xml","application/json"})
@Produces({"application/xml","application/json"})
public interface PermissionService
Manages permissions in XL Deploy.
-
Method Summary
Modifier and TypeMethodDescriptiongetGrantedPermissions
(String role) Gets all the permissions granted to a role.getGrantedPermissionsById
(String roleId) Gets all the permissions granted to a role.Gets the inheritance of parent permissions for a specific configuration item (CI).getIsInheritedParentAndPermissions
(String id, String rolePattern, com.xebialabs.deployit.engine.api.dto.Paging paging, com.xebialabs.deployit.engine.api.dto.Ordering order) getIsInheritedParentAndPermissions
(String id, String rolePattern, com.xebialabs.deployit.engine.api.dto.Paging paging, com.xebialabs.deployit.engine.api.dto.Ordering order, Boolean includeInherited) Gets the inheritance of parent permissions and permissions for a specific configuration item (CI).Gets all the permissions granted to the logged in user.default void
Grants a permission to a role on a CI.void
Grants a permission to a role on a CI.void
inheritParentPermissions
(String id, CIPermissionDto inheritParentPermission) Updates the inheritance of parent permissions and permissions for a specific configuration item (CI).default boolean
Checks if a permission is granted to a role on a CI.boolean
Checks if a permission is granted to a role on a CI.default boolean
isGrantedToMe
(String permission) Checks if the currently logged in user has a certain permission on a CI.boolean
isGrantedToMe
(String permission, String id) Checks if the currently logged in user has a certain permission on a CI.default void
Revokes the permission of a role on a CI.void
Revokes the permission of a role on a CI.void
updatePermissions
(String id, List<EditRolePermissionsDto> roles)
-
Method Details
-
getGrantedPermissions
@GET @Path("granted-permissions/{role}") Map<String,Collection<String>> getGrantedPermissions(@PathParam("role") String role) Gets all the permissions granted to a role.- Parameters:
role
- the role to get the permissions for.- Returns:
- a Map of configuration item ids to permissions granted to the user.
- Permission:
- security#edit
-
getGrantedPermissionsById
@GET @Path("granted-permissions/id/{roleId}") Map<String,Collection<String>> getGrantedPermissionsById(@PathParam("roleId") String roleId) Gets all the permissions granted to a role.- Parameters:
roleId
- the role to get the permissions for.- Returns:
- a Map of configuration item ids to permissions granted to the user.
- Permission:
- security#edit
-
getMyGrantedPermissions
Gets all the permissions granted to the logged in user.- Returns:
- a Map of configuration item ids to permissions granted the currently logged in user.
-
isGranted
@GET @Path("permission/{permission}/{role}/{id:.+}") boolean isGranted(@PathParam("permission") String permission, @PathParam("id") String id, @PathParam("role") String role) Checks if a permission is granted to a role on a CI.- Parameters:
permission
- the name of the permission to check.id
- the path of the CI to check the permission on.role
- the role to which the permission should be granted.- Returns:
true
if granted.- Permission:
- security#edit
-
isGranted
@GET @Path("permission/{permission}/{role}") default boolean isGranted(@PathParam("permission") String permission, @PathParam("role") String role) Checks if a permission is granted to a role on a CI.- Parameters:
permission
- the name of the permission to check.role
- the role to which the permission should be granted.- Returns:
true
if granted.- Permission:
- security#edit
-
grant
@PUT @Path("permission/{permission}/{role}/{id:.*}") void grant(@PathParam("permission") String permission, @PathParam("id") String id, @PathParam("role") String role) Grants a permission to a role on a CI.- Parameters:
permission
- the name of the permission to grant.id
- the path of the CI to grant the permission on.role
- the role to which the permission should be granted.- Permission:
- security#edit
-
grant
@PUT @Path("permission/{permission}/{role}") default void grant(@PathParam("permission") String permission, @PathParam("role") String role) Grants a permission to a role on a CI.- Parameters:
permission
- the name of the permission to grant.role
- the role to which the permission should be granted.- Permission:
- security#edit
-
revoke
@DELETE @Path("permission/{permission}/{role}/{id:.+}") void revoke(@PathParam("permission") String permission, @PathParam("id") String id, @PathParam("role") String role) Revokes the permission of a role on a CI.- Parameters:
permission
- the name of the permission to revoke.id
- the path of the CI to revoke the permission from.role
- the role from which the permission should be revoked.- Permission:
- security#edit
-
revoke
@DELETE @Path("permission/{permission}/{role}") default void revoke(@PathParam("permission") String permission, @PathParam("role") String role) Revokes the permission of a role on a CI.- Parameters:
permission
- the name of the permission to revoke.role
- the role from which the permission should be revoked.- Permission:
- security#edit
-
isGrantedToMe
@GET @Path("check/{permission}/{id:.+}") boolean isGrantedToMe(@PathParam("permission") String permission, @PathParam("id") String id) Checks if the currently logged in user has a certain permission on a CI.- Parameters:
permission
- the name of the permission to check.id
- the path of the CI to check the permission on.- Returns:
true
if the user has this permission;false
otherwise.
-
isGrantedToMe
@GET @Path("check/{permission}") default boolean isGrantedToMe(@PathParam("permission") String permission) Checks if the currently logged in user has a certain permission on a CI.- Parameters:
permission
- the name of the permission to check.- Returns:
true
if the user has this permission;false
otherwise.
-
updatePermissions
@PUT @Path("roles/{id:.+}/permissions") void updatePermissions(@PathParam("id") String id, List<EditRolePermissionsDto> roles) -
inheritParentPermissions
@PUT @Path("permission/roles/{id:.+}") void inheritParentPermissions(@PathParam("id") String id, CIPermissionDto inheritParentPermission) Updates the inheritance of parent permissions and permissions for a specific configuration item (CI).- Parameters:
id
- The unique identifier of the configuration item (CI) for which the parent permissions inheritance is being updated.inheritParentPermission
- A DTO object containing the flag indicating whether to inherit parent permissions. - `true`: Inherit parent permissions. - `false`: Do not inherit parent permissions.- Permission:
- security#edit
-
getInheritParentPermissionsById
@GET @Path("permission/inherit-parent/{id:.+}") CIPermissionDto getInheritParentPermissionsById(@PathParam("id") String id) Gets the inheritance of parent permissions for a specific configuration item (CI).- Parameters:
id
- The unique identifier of the configuration item (CI) for which the parent permissions inheritance is being updated.- Permission:
- security#edit
-
getIsInheritedParentAndPermissions
@GET @Path("permission/roles/{id:.+}") @Produces("application/json") Map<String,Object> getIsInheritedParentAndPermissions(@PathParam("id") String id, @QueryParam("rolePattern") String rolePattern, @BeanParam com.xebialabs.deployit.engine.api.dto.Paging paging, @QueryParam("order") com.xebialabs.deployit.engine.api.dto.Ordering order, @DefaultValue("false") @QueryParam("includeInherited") Boolean includeInherited) Gets the inheritance of parent permissions and permissions for a specific configuration item (CI).- Parameters:
id
- The unique identifier of the configuration item (CI) for which the parent permissions inheritance is being updated.rolePattern
- the role name pattern used for searchpaging
- which page and how many results per page to retrieveorder
- search order- Permission:
- security#edit
-
getIsInheritedParentAndPermissions
-