com.xebialabs.deployit.engine.api
Interface RoleService


public interface RoleService

Manages the roles in Deployit's security system.


Method Summary
 void assign(java.lang.String name, java.lang.String principal)
          Assigns a role to a user or group.
 void create(java.lang.String name)
          Creates a new role.
 void delete(java.lang.String name)
          Removes a role from the Deployit security system.
 java.util.List<java.lang.String> list()
          Lists the names of all available roles in the security system.
 java.util.List<java.lang.String> listMyRoles()
          Lists the roles of the currently logged in user.
 java.util.List<java.lang.String> listRoles(java.lang.String username)
          Lists the roles of a user.
 void rename(java.lang.String name, java.lang.String newName)
          Renames a role.
 void unassign(java.lang.String name, java.lang.String principal)
          Removes a role from a user or group.
 

Method Detail

list

java.util.List<java.lang.String> list()
Lists the names of all available roles in the security system.

Returns:
a list of role names.

listMyRoles

java.util.List<java.lang.String> listMyRoles()
Lists the roles of the currently logged in user.

Returns:
a list of role names.

listRoles

java.util.List<java.lang.String> listRoles(java.lang.String username)
Lists the roles of a user.

Parameters:
username - the username of the principal
Returns:
a list of role names.

create

void create(java.lang.String name)
Creates a new role. Does nothing if the role already exists.

Parameters:
name - the name of the new role.

assign

void assign(java.lang.String name,
            java.lang.String principal)
Assigns a role to a user or group. The role will be created if it doesn't exist yet.

Parameters:
name - the name of the role to assign
principal - the user or group to assign the role to.

unassign

void unassign(java.lang.String name,
              java.lang.String principal)
Removes a role from a user or group.

Parameters:
name - the name of the role to remove
principal - the user or group to remove the role from.

rename

void rename(java.lang.String name,
            java.lang.String newName)
Renames a role. Does nothing if the role does not exist.

Parameters:
name - the current name
newName - the new name

delete

void delete(java.lang.String name)
Removes a role from the Deployit security system. All assignments to principals are deleted as well.

Parameters:
name - the name of the role to delete.