Developer forum

Forum » Development » Create an extranet user and set parentId

Create an extranet user and set parentId

Søren Thestrup Hansen
Reply

I'm trying to use the API to create a Extranet user programmatically, but I've stumbled upon something odd.
When I use the User.Save() approach, the ParentId isn't set in the database (it's NULL) The user I'm creating is member of a Group which is supplied in the constructor. The intention is that this group should have access to a certain area of the website.

This might be alright, but it seems like all other users in this table have something other than NULL in the ParentId (e.g. 0)

Am I worrying too much or am I missing something in my user creation? (Maybe I haven't been able to fully understand the concept of ParentId ..)




Replies

 
Morten Snedker
Reply
This post has been marked as an answer
 Hi Søren,

The ParentID is intended for Extranet groups only, telling which group is the current group's parent. However, if the data has its origin in the "old" user management, the ParentID will be set for users as well. But using the new UserManagement it will be NULL for users. So using the new user management like
 Dynamicweb.Modules.UserManagement.User usr = new Dynamicweb.Modules.UserManagement.User();
you will find that the ParentID is not available as a property to the User object.

So you can happily proceed!  :-)

Regards /Snedker
Votes for this answer: 0

 

You must be logged in to post in the forum