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 all the permissions granted to the logged in user.default voidGrants a permission to a role on a CI.voidGrants a permission to a role on a CI.default booleanChecks if a permission is granted to a role on a CI.booleanChecks if a permission is granted to a role on a CI.default booleanisGrantedToMe(String permission) Checks if the currently logged in user has a certain permission on a CI.booleanisGrantedToMe(String permission, String id) Checks if the currently logged in user has a certain permission on a CI.default voidRevokes the permission of a role on a CI.voidRevokes the permission of a role on a CI.voidupdatePermissions(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:
trueif 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:
trueif 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:
trueif the user has this permission;falseotherwise.
-
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:
trueif the user has this permission;falseotherwise.
-
updatePermissions
@PUT @Path("roles/{id:.+}/permissions") void updatePermissions(@PathParam("id") String id, List<EditRolePermissionsDto> roles)
-