@Path(value="/security")
@Consumes(value={"application/xml","application/json"})
@Produces(value={"application/xml","application/json"})
public interface PermissionService
| Modifier and Type | Method and 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>> |
getMyGrantedPermissions()
Gets all the permissions granted to the logged in user.
|
void |
grant(java.lang.String permission,
java.lang.String id,
java.lang.String role)
Grants a permission 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.
|
boolean |
isGrantedToMe(java.lang.String permission,
java.lang.String id)
Checks if the currently logged in user has a certain permission 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.
|
@GET
@Path(value="granted-permissions/{role}")
java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getGrantedPermissions(@PathParam(value="role")
java.lang.String role)
role - the role to get the permissions for.@GET @Path(value="granted-permissions") java.util.Map<java.lang.String,java.util.Collection<java.lang.String>> getMyGrantedPermissions()
@GET
@Path(value="permission/{permission}/{role}/{id:.*?}")
boolean isGranted(@PathParam(value="permission")
java.lang.String permission,
@PathParam(value="id")
java.lang.String id,
@PathParam(value="role")
java.lang.String role)
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.true if granted.@PUT
@Path(value="permission/{permission}/{role}/{id:.*?}")
void grant(@PathParam(value="permission")
java.lang.String permission,
@PathParam(value="id")
java.lang.String id,
@PathParam(value="role")
java.lang.String role)
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.@DELETE
@Path(value="permission/{permission}/{role}/{id:.*?}")
void revoke(@PathParam(value="permission")
java.lang.String permission,
@PathParam(value="id")
java.lang.String id,
@PathParam(value="role")
java.lang.String role)
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.@GET
@Path(value="check/{permission}/{id:.*?}")
boolean isGrantedToMe(@PathParam(value="permission")
java.lang.String permission,
@PathParam(value="id")
java.lang.String id)
permission - the name of the permission to check.id - the path of the CI to check the permission on.true if the user has this permission; false otherwise.