+ Reply to Thread
Results 1 to 3 of 3
-
01-22-2009 06:36 PM #1
Junior Member
- Join Date
- Jan 2009
- Posts
- 6
Strange behaviour when adding users to Groups
As per my previous post, I successfully used the Direct API to add a network (AD) user to Checkbox. However, I then tried to add to add the user to a Checkbox group and save the group and received the following error:
"Unable to save data".
The code is basically:
---
Group group = Group.GetGroup("Group1");
group.AddUser("User1");
group.Save();
---
So I switched back to the Web Services API just for group management and while there was no error, the user wasn't being added to the group.
The code was:
---
_userManagementProxy.AddUserToGroup(_contextToken. Value,
"User1", role.DatabaseId);
---
So then I adjusted to User Name to be:
"DOMAIN/User1" [Note the forward slash which I thought strange, but guessed it from how it's displayed in the Checkbox UI].
This then worked, which is great. So I'll probably stick to this hybrid method until the new version.
-
01-22-2009 08:50 PM #2
Administrator
- Join Date
- Mar 2007
- Posts
- 385
I am not sure why an exception was thrown. I will take a look in the morning when I get in.
As you have discovered, user management methods expect a user's unique identifier not their username. In the case of a network user the unique identifier is domain/username. When creating a user their unique identifier should be the return value. If you are unsure of a users unique identifier you can look it up in the ckbx_Credential table.
A unique identifier is used rather than username so that a Checkbox user and a network user can have the same name.
-
01-22-2009 10:29 PM #3
Junior Member
- Join Date
- Jan 2009
- Posts
- 6
Thanks - the Direct API probably failed because I didn't use the unique domain/username token as the username, so it may have failed to save the group as the user didn't exist.


LinkBack URL
About LinkBacks
Reply With Quote

