It's all about the answers!

Ask a question

How to retrieve User Groups in a community using RAM API


Abhilash Boinapally (011314) | asked Mar 05 '13, 9:13 a.m.
 Hi,
      Is there a way to retrieve User Groups and users in a Community using RAM API?

Thanks,
Abhilash



One answer



permanent link
Rich Kulp (3.6k38) | answered Mar 05 '13, 10:51 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
No there isn't a way to get these through RAM API.

You can get a specific user from RAMSession. But you need to know the user's userid.

Comments
Abhilash Boinapally commented Mar 08 '13, 6:45 a.m. | edited Mar 08 '13, 6:47 a.m.

Thank you Richard. I saw a similar requirement in the Jazz and following the below Thread.




As a work around i am trying this way also for my requirement as stated above. When I am trying to work with the code i am getting an odd error if i include import com.ibm.ram.repository.security.SecurityManager; as shown below.



With the help of the below I should be able to access the users from the groups associated to the lifecycle

 String groupId = JAXBLinksUtil.getUserGroupIdentifier(reviewer.getUserGroup().getHref()); 
               UserGroupInstance userGroup = null; 
               try 
               { 
                  userGroup = SecurityManager.getManager().getUserGroup(Integer.parseInt(groupId)); 
               } catch (NumberFormatException e) { 
                  System.out.println("Exception: \n" + e.toString()); 
               } catch (Exception e) { 
                  System.out.println("Exception: \n" + e.toString()); 
               } 


Please let me know what should i do to fix the error.

Thanks,
Abhilash


Rich Kulp commented Mar 08 '13, 10:01 a.m.
FORUM MODERATOR / JAZZ DEVELOPER

That code is not and is not available to RAM API. It is only available to RAM code running in the RAM server. It is not available outside of internal RAM.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.