Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
Changing Owners
GlenW
Once I create a workspace through my VB.Net code, the owner is the person running the code. How (in VB.Net) can I change the owner to "NRTADMIN"?
Thanks,
Glen
Find more posts tagged with
Comments
jny
Why aren't you logged on as NRTADMIN for creating a workspace to have NRTADMIN as the owner?
In pre-8.0 API's, modifying the page owner is unsupported. You may however change the owner using the 8.0 Interfaces. Like so:
[C#]
// Assuming that oWS is a valid workspace object.
IManUser oNewUser = oSess.PreferredDatabase.GetUser("NRTADMIN");
oWS.Owner = oNewUser;
oWS.Update();
GlenW
I am logged in as NRTADMIN. That's what was so baffling.
jny
In your original message, you stated that "the owner is the person running the code". Who is the person running the code? Does running the code means that the code that you run is logged on by this person? If so, this person is not the NRTADMIN? Sorry, I'm confused.
If, in code, you are logged on as NRTADMIN, and create a workspace using the NRTADMIN connected session, the workspace owner should be NRTADMIN even without explicitly setting the Owner property. It couldn't possibly be anyone other than the logged on user.
You're saying that you logged on as NRTADMIN, created a workspace using the NRTADMIN Session's database, and the workspace owner is another user?
GlenW
All actions are "in code". I log on using the NRTAdmin credentials yet the owner is my active-directory userid.
jny
That is rather strange. Your code that has the Login "username", "mhdocs" should connect to a session that belongs to that user, irrespective of your machine's domain account -- even if it's defined in the Worksite database to be used for TrustedLogin.
In other words, if in code, you call TrustedLogin, and the session is connected successfully, then session.UserID should return your domain account login user, namely your ADS userid. If, however, on that same machine, in code, you call Login "NRTADMIN", "mhdocs", and the session is connected successfully, session.UserID should return the username "NRTADMIN"; hence the session belongs to the NRTADMIN user and the workspace under which is created should have NRTADMIN as the owner. The iManage.dll does not do anything special in the implementation of the Login method because the call from where the machine is made has a domain account user that isn't the user who is in the Login method.