Can anyone please help me to extract the list of usergroups and their respective universe folders in a particular environment.
My requirement is to extract Users and their respective Universe folders. I had divided the requirement into two parts. Users -> Usergroups and Usergroups -> Universe Folders.
I found and successfully completed by the first part. Please help me for the second part. Macro will be more helpful.
There is no inherit relationship between usergroups and universe folders.
You may be adding multiple usergroups to the ‘User Security’ list for each universe folder - so that is the way you would need to tackle it i.e. for each folder, list the members of the ‘User Security’ list.
The other way (probably easier as you seem to already be able to list the members of a usergroup) is to create a usergroup for each universe folder.
Example: you have universe folders, UnvFolderA & UnvFolderB
Create two usergroups, UnvFolderA_Users & UnvFolderB_Users
Then
add UnvFolderA_Users into the ‘User Security’ list for UnvFolderA and assign security
add UnvFolderB_Users into the ‘User Security’ list for UnvFolderB and assign security
You then add users/usergroups as members of usergroups, UnvFolderA_Users & UnvFolderB_Users.
Then you can just list out the members of UnvFolderA_users when you need to know who has access to UnvFolderA.
I cant add the security to the user and usergroups at this stage as the whole environment is already set.
Can you please tell me the other way such that, i need list of all the universes in the environment and the users have access to the universe respectively?
Soniya, here’s how to get this using the Java SDK:
Start from the universe folders - I usually get the SI_ID of the root universe folder and then query SELECT * FROM CI_SYSTEMOBJECTS AND SI_PARENTID = 563 AND SI_KIND = ‘Folder’ - this will get you all of the folders that are directly under the root (at the top level). If you have subfolders, you’ll need to use recursion to walk down the folder tree to get the information.
For each folder, call .getSecurityInfo2() to get an ISecurityInfo2.
For the ISecurityInfo2, call .getExplicitPrincipals() to get the list of groups that have access to the folder. If there are any users explicitly assigned to the folder, they’ll be in that list too.
If you just want the list of user groups that are explicitly assigned to the folder, you’re done. If you want the list of groups that have inherited access to the folder, you’ll need to repeat step 3 with .getEffectivePrincipals(). If you want to know what access they have, you’ll need to use .getRoles() on the individual IExplicitPrincipal and/or IEffectivePrincipal object to get the SI_ID of the access level that has been used to assign access.