cancel
Showing results for 
Search instead for 
Did you mean: 

IGroupFactory "is not a unique id of a user!" Error, on addUserToGroup

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

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