It's all about the answers!

Ask a question

RAM API to find Communities based on User Acccess Role


Manisha Srivastava (61) | asked Jul 01 '10, 7:02 a.m.
I need to use the RAM API to find out the communities for the logged in user in RAM where the user has Asset Consumer role.
In com.ibm.ram.client.RAMSession class there APIs to get the all the communities and also where the user has Asset Producer Roles and Administrator roles.
Need help on how to find the communities with Asset Consumer role using RAMClient APIs.

9 answers



permanent link
Rich Kulp (3.6k38) | answered Jul 01 '10, 11:54 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hi,

There isn't one. And to be precise there isn't one that returns the
communities that the user has the AssetProducer role either. It isn't
looking for that. It is looking for communities that the user can create
assets within. Instead it is all roles that the user has that have the
"Create" entitlement turned on, which can be more than just AssetProducer.

Rich

permanent link
Gili Mendel (1.8k56) | answered Jul 08 '10, 9:32 a.m.
JAZZ DEVELOPER
Not sure that I understand the question,

...API to find out the communities for the logged in user in RAM where the user has Asset Consumer role


Asset Consumer is a dynamic role and can hold any level or entitlement permutation, regardless of the role's name.

Users are not "members" of a community ... they have a "set" of permissions (roles) on various community.

What are you asking for?

Is it which communities one can create assets in.
Which communities One can download assets from (are types important)
Which communities I can see assets
...

permanent link
Nitin Nayak (16) | answered Jul 08 '10, 12:49 p.m.
Thanks for the clarification Gili.
To start with, we would like to identify those communities where the user has "Download Assets" permission. Later on, we would like to identify communities based on some boolean combination of two or more permissions (e.g. "Download assets" AND "Subscribe to Assets"). Let me know if you need further clarification. Thanks.

permanent link
Manisha Srivastava (61) | answered Jul 08 '10, 12:50 p.m.

What are you asking for?

Is it which communities one can create assets in.
Which communities One can download assets from (are types important)
Which communities I can see assets
...



I need to find the communities where the User is able to search and download assets.

permanent link
Gili Mendel (1.8k56) | answered Jul 08 '10, 1:07 p.m.
JAZZ DEVELOPER
As Rich noted earlier... there is no such API because the computation can be quite complex:

What you can see/download, really depends on Roles (Roles can be limited to categories/types), what state (collaborators, state's permission override) the asset is in, and Asset specific permission.

We go at great length to "pre compute this" so that general search is quite efficient ... and independent on communities.
==============

We have not seen a need for such API, as communities are typically a container ... what you can do, really depends on multiple things (as noted above).

==============

Can you describe the use case scenario that makes it necessary to know in advance such things?

permanent link
Nitin Nayak (16) | answered Jul 08 '10, 3:42 p.m.
Can you describe the use case scenario that makes it necessary to know in advance such things?

Use case is as follows:

    1. Enterprise has one Asset Repository
    2. Enterprise has several organizations
    3. Each organization (say Org-A) is logically incharge of assets within a community (say Comm-A) assigned to it.
    4. So users from this organization (Org-A) have permission to Create Assets, Delete Assets, and Download Assets in community Comm-A.
    5. Users from organizations outside Org-A have only Download Assets permission to assets in Comm-A.
    6. Our Tool, which leverages the RAM repository, wants to present a list of communities in its UI so a user may select one or more communities where she has Download Asset permission (and where such community contains assets).
    7. Our Tool would then using RAM APIs to download assets from these user-selected communities.

permanent link
Rich Kulp (3.6k38) | answered Jul 09 '10, 11:21 a.m.
FORUM MODERATOR / JAZZ DEVELOPER
Hi,

Then you will only be asking on the behalf of a particular user and not
on say "All users who have download in a community". There may be
something which can help if you are looking for a single user instead of
all users.

This information is in the index, but unfortunately I don't see how do
this search through the RAMClient and get the necessary info. It doesn't
expose the necessary fields. And I think it prevents searching for the
community asset field, which is needed to search just community like
above. This info is more complete then just looking for roles for a user.

It would be like the results shown on the Communities tab for a user,
but with additional restriction of only if they have a download
authority. This wouldn't narrow it down to there being assets in that
community that they can download, only that they have authority in that
community to do downloads for some assets.

Sorry I couldn't be more helpful.

Rich

permanent link
Nitin Nayak (16) | answered Jul 09 '10, 11:44 a.m.
... It would be like the results shown on the Communities tab for a user,
but with additional restriction of only if they have a download
authority. This wouldn't narrow it down to there being assets in that
community that they can download, only that they have authority in that
community to do downloads for some assets.

If we could do what you suggest above through the RAMClient API then I think it should work for us. Do you think it is doable with the current RAM APIs? If yes then we would like to understand the details better.

permanent link
Gili Mendel (1.8k56) | answered Jul 09 '10, 11:48 a.m.
JAZZ DEVELOPER
Assuming that a consumer can download all the comes up on a search result
will the following work for figuring out which communities you can download from:

Do a search * on behalf of that user and look at the community facets that comes back (using rest: https://<server>/ram/internal/search ... the atom feed you get back will have the


<name>fGroup</name>
<displayName>Community</displayName>
.... list of communites .....



Regarding to which community one has upload support, you can do teh following from Java:


RAMCommunity[] RAMSession.getCommunitiesUserCanSubmitTo()


Or from Rest (https://jazz.net/wiki/bin/view/Main/RamRestApiMain),
when you go throw the service discovery, when you get to the RAM services ( http://<server>/ram/oslc/servicesCatalog ) It will return you service providers per community that you have access to, including the top repository level server.

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.