cancel
Showing results for 
Search instead for 
Did you mean: 

Getting Roles assigned to Workset

Former Member
0 Kudos

How can you retrieve all the workset attached to a role?

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi,

You can retrieve the roles assigned to user using the code below:

String userLogonID = "DUMMY_USER";

String userUniqueID;

try {

userUniqueID = UMFactory.getUserFactory().getUserByLogonID(userLogonID).getUniqueID();

} catch (UMException e) {

userUniqueID = null;

e.printStackTrace();

}

if (userUniqueID != null) {

IRoleFactory roleFactory = UMFactory.getRoleFactory();

String[] roles = roleFactory.getRolesOfUser(userUniqueID, true);

IRole role;

if (roles != null) {

for (int i=0; i<=roles.length; i++) {

try {

role = roleFactory.getRole(roles<i>);

//use IPcdContext to retrieve embedded context from the role

} catch (UMException e) {

e.printStackTrace();

}

}

}

}

Unfortunately I’m not ready to provide an exact code for worksets retrieving right now, please review the following link to find out how to work with PcdContext:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/library/javadocs/nw04/sp12...

Thanks,

Yauheni.

Former Member
0 Kudos

Hi maan,

Do you want to retrieve all the workset attached to a role at runtime??

You can right click on the role and open object.. it will show you all workset, pages and iview attached with this role.

Rdgs,

Raj

Former Member
0 Kudos

Hi Raj,

Yes, I need to retrieve all the worksets attached to a role at runtime on the Java side.

I have an input field where the user can enter any login ID and the code should output all roles and worksets assigned to the role.

Thanks