Change Privileges (Data Management)
Summary
Establishes or changes user access privileges to the input ArcSDE datasets, stand-alone feature classes, or tables.
Usage
-
To edit ArcSDE datasets, both the View and Edit parameters must be set to GRANT. Edit privileges are dependent on the View privilege, since you cannot edit what you cannot see (view).
-
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
Parameter | Explanation | Data Type |
in_dataset [in_dataset,...] |
The datasets, feature classes, or tables whose access privileges will be changed. | Layer; Table View; Dataset |
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 |
Code Sample
The following stand-alone script demonstrates how to grants 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 = "Database Connections/gdb@production.sde/production.GDB.ctgFuseFeature"
# Execute ChangePrivileges
arcpy.ChangePrivileges_management(datasetName, "WENDELCLARK", "GRANT", "GRANT")