Summary
Establishes or changes user access privileges to the input enterprise database datasets, stand-alone feature classes, or tables.
Usage
To edit enterprise geodatabase datasets, both of the following are required:
- The View parameter must be set to Grant view privileges (GRANT in Python).
- The Edit parameter must be set to Grant edit privileges (GRANT in Python).
Edit privileges may be revoked, but you can still view the dataset. However, if the View privilege is revoked, the Edit privileges will automatically be revoked as well.
The relational database management system (RDBMS) equivalent command for the View parameter is Select.
The RDBMS equivalent commands for the Edit parameter are Update, Insert, and Delete. All three are granted or revoked simultaneously by the Edit parameter.
The parameter descriptions below use the terms user or user name. Database roles can also be used in place of user names. On RDBMS platforms that support operating system groups, the operating system group can also be specified in place of user names.
Syntax
ChangePrivileges_management (in_dataset, user, {View}, {Edit})
Parameter | Explanation | Data Type |
in_dataset [in_dataset,...] | The datasets, feature classes, or tables whose access privileges will be changed. | Layer; Table View; Dataset; Address Locator |
user | The database user name whose privileges are being modified. | String |
View (Optional) | Establishes the user's view privileges.
| String |
Edit (Optional) | Establishes the user's edit privileges.
| String |
Derived Output
Name | Explanation | Data Type |
out_dataset | Layer; Table View; Dataset |
Code sample
ChangePrivileges example (stand-alone script)
The following stand-alone script demonstrates how to grant view and edit privileges to WendelClark.
# Name: GrantPrivileges_Example.py
# Description: Grants view and edit privileges to WendelClark
# Import system modules
import arcpy
# Set local variables
datasetName = "c:/Connections/gdb@production.sde/production.GDB.ctgFuseFeature"
# Execute ChangePrivileges
arcpy.ChangePrivileges_management(datasetName, "WENDELCLARK", "GRANT", "GRANT")
Environments
Licensing information
- ArcGIS Desktop Basic: No
- ArcGIS Desktop Standard: Yes
- ArcGIS Desktop Advanced: Yes