com.collabnet.ce.webservices
Class RbacApp

java.lang.Object
  extended by com.collabnet.ce.webservices.AbstractSoapApp
      extended by com.collabnet.ce.webservices.RbacApp

public class RbacApp
extends AbstractSoapApp

Class to hold the role-related methods. Wraps a collabNetApp.


Constructor Summary
RbacApp(CollabNetApp collabNetApp)
          Constructs a new RbacApp.
 
Method Summary
 void addRole(java.lang.String projectId, java.lang.String role, java.lang.String description)
          Add a single role to the project.
 boolean addRoles(java.lang.String projectId, java.lang.String[] roles, java.lang.String[] descriptions)
          Add a set of roles with descriptions to the project.
 java.util.Collection<java.lang.String> getRoleMembers(java.lang.String roleId)
          Get a list of users that are members of a given role
 java.util.Map<java.lang.String,java.lang.String> getRoles(java.lang.String projectId)
           
 java.util.Collection<java.lang.String> getUserRoles(java.lang.String projectId, java.lang.String username)
          Get a list of role the user has in the given project.
 void grantRole(java.lang.String roleId, java.lang.String username)
          Grant the given role to the user.
 void grantRole(java.lang.String projectId, java.lang.String roleName, java.lang.String username)
          Grant the given role to the user.
 
Methods inherited from class com.collabnet.ce.webservices.AbstractSoapApp
checkValidSessionId, getServerUrl, getSessionId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RbacApp

public RbacApp(CollabNetApp collabNetApp)
Constructs a new RbacApp.

Parameters:
collabNetApp - a valid (logged-in) instance.
Method Detail

getRoles

public java.util.Map<java.lang.String,java.lang.String> getRoles(java.lang.String projectId)
                                                          throws java.rmi.RemoteException
Parameters:
projectId - the project id
Returns:
map (name->id) of roles associated with the given project
Throws:
java.rmi.RemoteException

addRoles

public boolean addRoles(java.lang.String projectId,
                        java.lang.String[] roles,
                        java.lang.String[] descriptions)
                 throws java.rmi.RemoteException
Add a set of roles with descriptions to the project. Only adds roles if they are not already present.

Parameters:
projectId -
roles - to add (only added if missing).
descriptions - of roles to add (the nth description refers to the nth role)
Returns:
true if some roles were added, false if none were.
Throws:
java.rmi.RemoteException

addRole

public void addRole(java.lang.String projectId,
                    java.lang.String role,
                    java.lang.String description)
             throws java.rmi.RemoteException
Add a single role to the project. Does not pre-check for existence.

Parameters:
projectId -
role -
description -
Throws:
java.rmi.RemoteException

grantRole

public void grantRole(java.lang.String projectId,
                      java.lang.String roleName,
                      java.lang.String username)
               throws java.rmi.RemoteException
Grant the given role to the user.

Parameters:
projectId -
roleName -
username -
Throws:
java.rmi.RemoteException

grantRole

public void grantRole(java.lang.String roleId,
                      java.lang.String username)
               throws java.rmi.RemoteException
Grant the given role to the user.

Parameters:
roleId -
username -
Throws:
java.rmi.RemoteException

getUserRoles

public java.util.Collection<java.lang.String> getUserRoles(java.lang.String projectId,
                                                           java.lang.String username)
                                                    throws java.rmi.RemoteException
Get a list of role the user has in the given project.

Parameters:
projectId -
username -
Throws:
java.rmi.RemoteException

getRoleMembers

public java.util.Collection<java.lang.String> getRoleMembers(java.lang.String roleId)
                                                      throws java.rmi.RemoteException
Get a list of users that are members of a given role

Parameters:
roleId - the id of the role to get
Throws:
java.rmi.RemoteException


Copyright © 2010. All Rights Reserved.