AnsweredAssumed Answered

Change Privileges for multiple users or roles

Question asked by patton44 on Nov 3, 2016
Latest reply on Nov 8, 2016 by patton44

Through ArcObjects code in a C# executable I am creating a table in SDE and setting the user privileges. To set the user privileges I am using the geoprocessing tool ChangePrivileges. The executable runs overnight on our SDE server. It has been running successfully for years. I am in the process of upgrading the executable to 10.4.1. When I run the exe to test, it fails on the ChangePrivilges tool. I get the error "Bad login user". This is referring to the USER parameter of ChangePrivileges. I specify three names for the parameter.


gpPrivileges.user = "CITY_VIEWER,CNTY_VIEWER,GISWEB"; 


This line is part of the exe that successfully runs on our SDE server each night. I have tried altering the parameter to include only one user and that works. Has something changed with how multiple users are defined for this parameter? Are you no longer able to define multiple users or roles for this parameter? Our SDE is 10.1. It is understandable that usage of the tool in ArcObjects could have changed but I have not been able to find any documentation in support or against this.


Below, is the full code that is used to change privileges. Thanks to anyone who can provide help on setting privileges for a table with multiple users.


Geoprocessor gp = new Geoprocessor();
   X = 1;
   ChangePrivileges gpPrivileges = new ChangePrivileges();
   gpPrivileges.in_dataset = mCitySdeDbConn + @"\" + mCogParcelAttOld;
   gpPrivileges.user = "CITY_VIEWER,CNTY_VIEWER,GISWEB";
   gpPrivileges.View = "GRANT";
   gp.Execute(gpPrivileges, null);
   if (gp.MessageCount > 0)
      for (int x = 0; x <= gp.MessageCount - 1; x++)
X = 0;