Can I grant privileges for geodatabase dataset stored in enterprise SQL Sever with SQL but not arcgis client or python script?

485
1
03-31-2020 08:53 PM
gaofangwan
New Contributor II

Sir who will deal with it:

According to offical document, there are three ways to grant and revoke dataset privileges as follows:

1.Use the Privileges dialog box

2.Use the Change Privileges tool

3.Use a Python script

What I want to know is, when geodataset stores in enterprise SQL server with sde,  if I can grant and revoke dataset privileges with SQL statement like 

"

Use xxx

Grant SELECT, INSERT, UPDATE, DELETE on xxx.xxx.xxx To xxx

"?

Here is the document of Microsoft SQL server.

0 Kudos
1 Reply
VinceAngelo
Esri Esteemed Contributor

Well, you could, but probably not through an Esri API.  The "USE database" is incompatible with the Enterprise geodatabase connection file (.sde) being linked to a specific database. 

In theory, the USE isn't required, so an arcpy.ArcSDESQLExecute() request could issue the GRANT command, but the principal benefit of using an Enterprise geodatabase is to take advantage of versioning and geodatabase behaviors, and only a tool like ChangePrivileges is going to know which tables participate in geodatabase functionality, so if you roll your own, you might have permission issues later on down the road (for example, feature datasets have the permission of the least access of the members, so if you miss one GRANT, you might not have any access at all).

- V