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)
          Deprecated. Use GET /security/check.
 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.
 

Method Detail

getGrantedPermissions

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.

Parameters:
role - the role to get the permissions for.
Returns:
a Map of configuration item ids to permissions granted to the user.

getMyGrantedPermissions

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

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

@Deprecated
void checkMyPermission(java.lang.String permission,
                                  java.lang.String id)
Deprecated. Use GET /security/check.

Deprecated - Use GET /security/check. 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.

isGrantedToMe

boolean isGrantedToMe(java.lang.String permission,
                      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.