com.collabnet.ce.webservices
Class RbacApp

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

public class RbacApp
extends java.lang.Object

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> 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 projectId, java.lang.String roleName, java.lang.String username)
          Grant the given role to the user.
 
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.Collection<java.lang.String> getRoles(java.lang.String projectId)
                                                throws java.rmi.RemoteException
Parameters:
projectId -
Returns:
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

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


Copyright © 2009. All Rights Reserved.