Interface PermissionService
-
@Path("/security") @Consumes({"application/xml","application/json"}) @Produces({"application/xml","application/json"}) public interface PermissionService
Manages permissions in XL Deploy.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>
getGrantedPermissions(java.lang.String role)
Gets all the permissions granted to a role.java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>
getGrantedPermissionsById(java.lang.String roleId)
Gets all the permissions granted to a role.java.util.Map<java.lang.String,java.util.Collection<java.lang.String>>
getMyGrantedPermissions()
Gets all the permissions granted to the logged in user.default void
grant(java.lang.String permission, java.lang.String role)
Grants a permission to a role on a CI.void
grant(java.lang.String permission, java.lang.String id, java.lang.String role)
Grants a permission to a role on a CI.default boolean
isGranted(java.lang.String permission, java.lang.String role)
Checks if a permission is granted to a role on a CI.boolean
isGranted(java.lang.String permission, java.lang.String id, java.lang.String role)
Checks if a permission is granted to a role on a CI.default boolean
isGrantedToMe(java.lang.String permission)
Checks if the currently logged in user has a certain permission on a CI.boolean
isGrantedToMe(java.lang.String permission, java.lang.String id)
Checks if the currently logged in user has a certain permission on a CI.default void
revoke(java.lang.String permission, java.lang.String role)
Revokes the permission of a role on a CI.void
revoke(java.lang.String permission, java.lang.String id, java.lang.String role)
Revokes the permission of a role on a CI.
-
-
-
Method Detail
-
getGrantedPermissions
@GET @Path("granted-permissions/{role}") java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getGrantedPermissions(@PathParam("role") java.lang.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}") java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getGrantedPermissionsById(@PathParam("roleId") java.lang.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
@GET @Path("granted-permissions") java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> 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") java.lang.String permission, @PathParam("id") java.lang.String id, @PathParam("role") java.lang.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") java.lang.String permission, @PathParam("role") java.lang.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") java.lang.String permission, @PathParam("id") java.lang.String id, @PathParam("role") java.lang.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") java.lang.String permission, @PathParam("role") java.lang.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") java.lang.String permission, @PathParam("id") java.lang.String id, @PathParam("role") java.lang.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") java.lang.String permission, @PathParam("role") java.lang.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") java.lang.String permission, @PathParam("id") java.lang.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") java.lang.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.
-
-