on 10-25-2005 1:07 AM
Hi All,
I have and application in webdynpro and I need include a java code to Add a role to the current user acording to an action in my program.
I would like to know if is possible add and delete a role from the application.
Thanks in advance,
Alexis
You can assign portal roles to user using the UMFactory. Please do check the same.
It is possible to assign the role to user through code.
UMFactory rf = UMFactory.getRoleFactory();
rf.addUserToRole("petermueller", "role1");
But the above code is from a portal perspective do check with regard to webdynpro.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I hope this is what you require.
IUser user=UMFactory.getUserFactory().getUserByUniqueName("<userId>");
String name= user.getUniqueID();
IRoleFactory fact=UMFactory.getRoleFactory();
IRole role=fact.getRoleByUniqueName("super_admin_role");
String roleId=role.getUniqueID();
fact.addUserToRole(name,roleId);
Please let me know.
Hello Noufal!
this sounds great, but where has this code to be executed?
I have a similar problem; New users from a R/3-backend are replicated to the portal's user database.
According to R/3-roles I have to assign portal roles to these new portal users automatically.
Where do I have to implement appropriate coding?
thanks
Andreas
Did you end up writing a custom login module to assign the portal roles dynamically according to what R/3 roles they had?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.