cancel
Showing results for 
Search instead for 
Did you mean: 

How to get the the required unique ID from IResourceAclEntry -- High points

lakshmi_narayana2
Active Participant
0 Kudos

All

Am writing code to create ACL's.As part of it am getting the user,groups,Roles as shown below.

umPrincipalUser = WPUMFactory.getUserFactory().getUser(struid);

umPrincipalGroup = WPUMFactory.getGroupFactory().getGroup(struid);

umPrincipalRole = WPUMFactory.getRoleFactory().getRole(struid);

String struid am getting as follows

String struid = null;

IResourceAclEntryListIterator iAclIterator = null;

IResourceAclEntry entry = null

while (iAclIterator.hasNext()){

entry = iAclIterator.next();

struid = entry.getPrincipal().getId()

}

The struid retrieved works fine for umPrincipalUser but umPrincipalGroup and umPrincipalRole returns null for the strUid.

Pl let me know what is the exact id format i should pass for Group and Role.

Immediate correct answers will be awarded with maximum points

Thanks

Accepted Solutions (0)

Answers (1)

Answers (1)

detlev_beutner
Active Contributor
0 Kudos

Hi Steve,

Why do you first call getPrincipal(), retrieve the ID of that, and then "rebuild" that principal via the WPUMFactory? If you really want that "old" (KM) IPricipals (users/groups/roles), just use

umPrincipal = entry.getPrincipal();
if (umPrincipal instanceof ...) {...

This probably could make your life easier?!

Hope it helps

Detlev

PS: Please mark code with the CODE tag of the SDN editor, which makes it much more readable.