on 09-26-2008 8:45 AM
Hello Experts,
I want to remove the role for the corresponding user in runtime, by clicking the deletebutton next to that role.
Role1 deleteimage | Role2 deleteimage | Role3 deleteimage
I acheived this for the Role which is currently selected.
How can i acheive this?
Valuable answers will be rewarded.
Regards,
Aksiti.
Hi,
One idea would be to create a portal component which takes the pcd path of role as request parameter and unassignes the role for the current user.
Check UME api to remove role from current user here:
http://help.sap.com/javadocs/NW04/current/um/index.html
code:
UMFactory.getRoleFactory().removeUserFromRole(<userid>,<roleid>);
So when you render the delete icon have a href calling your portal component to delete role with appropriate pcd path to role.
Regards,
Praveen Gudapati
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello
Can u tell me how to pass parameter dynamically in HTMLB onClientClick function?
If i am passing onClientClick('<%=Roleid%>') means, it is not displaying the value of the Roleid.
it is only showing <%=RoleiD%>
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
IUser user = null;
String portal_user_name =null;
int y_v_no_of_roles = 0 ;
IRole irole = null;
try
{
user = (IUser)WDClientUser.getCurrentUser().getSAPUser();
}
catch(WDUMException e)
{
wdComponentAPI.getMessageManager().reportSuccess("fail to get current user1" +e.getLocalizedMessage());
}
try
{
irole = UMFactory.getRoleFactory().getRoleByUniqueName(wdContext.nodePortal_Role_Name().getPortal_Role_NameElementAt(i).getRole_Name().trim());
}
catch(UMException e)
{
wdComponentAPI.getMessageManager().reportSuccess("Fail to get Role" +e.getLocalizedMessage());
}
if(user.isMemberOfRole(irole.getUniqueID(),true))
{
String useruid=user.getUniqueID();
String roleuid=irole.getUniqueID();
try
{
UMFactory.getRoleFactory().RemoveUserFromRole(useruid,roleuid);
}
catch(UMException e)
{
wdComponentAPI.getMessageManager().reportException("Fail to add user" +e.getLocalizedMessage(),true);
}
}
this code for your requirement
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.