on 04-10-2008 2:10 AM
Hi,
I´m using the security API to create groups from a webservice but I´m getting this Error message:
"is not a unique id of a user!"
This is the simple Code I´m using:
public String assignGrouptoUser(String UserId, String GroupId)
{
String errores="";
IGroupFactory addUsertoGroup = UMFactory.getGroupFactory();
try{
addUsertoGroup.addUserToGroup(UserId,GroupId);
}
catch (UMException e) {
e.printStackTrace();
errores=e.getMessage();
}
return ("El usuario "UserId" fue asignado al grupo "GroupId" con mensaje de error "+errores);
}
The user I´m trying to add is not duplicated but is sending me that message, has someone seen this errror and knows how to solve it?
Thanx in Advanced!
Kind Regards,
Gerardo J
Hi,
This was solved now thanx God, here the code:
public String assignUsertoGroup(String UserId, String GroupId)
{
String message="The user "UserId" is now assigned to the group "+GroupId;
IUserFactory uf = UMFactory.getUserFactory();
IGroupFactory gf = UMFactory.getGroupFactory();
try{
gf.addUserToGroup(uf.getUserByLogonID(UserId).getUniqueID(),gf.getGroupByUniqueName(GroupId).getUniqueID());
}
catch (UMException e) {
return "There was an error assigning the user "UserId" to the group "GroupId": "+e.getMessage();
}
return (message);
}
Kind Regards,
Gerardo J
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
9 | |
7 | |
6 | |
5 | |
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.