com.xebialabs.deployit.engine.api
Interface PermissionService


public interface PermissionService

Manages permissions in Deployit.


Method Summary
 void checkMyPermission(java.lang.String permission, java.lang.String id)
          Checks if the currently logged in user has a certain permission 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.
 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.
 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

isGranted

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.

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.

grant

void grant(java.lang.String permission,
           java.lang.String id,
           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.

revoke

void revoke(java.lang.String permission,
            java.lang.String id,
            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.

checkMyPermission

void checkMyPermission(java.lang.String permission,
                       java.lang.String id)
Checks if the currently logged in user has a certain permission on a CI. If the user does not have this permission, error code 403 is returned.

Parameters:
permission - the name of the permission to check.
id - the path of the CI to check the permission on.