Change Privileges (Data Management)

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 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.

Parameters

LabelExplanationData Type
Input 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 (Select)
(Optional)

Establishes the user's view privileges.

  • Do not change to view privilegesNo change to the user's existing view privilege. If the user has view privileges, they will continue to have view privileges. If the user doesn't have view privileges, they will continue to not have view privileges.
  • Grant view privilegesAllows user to view datasets.
  • Revoke view privilegesRemoves all user privileges to view datasets.
String
Edit (Update/Insert/Delete)
(Optional)

Establishes the user's edit privileges.

  • Do not change edit privileges No change to the user's existing edit privilege. If the user has edit privileges, they will continue to have edit privileges. If the user doesn't have edit privileges, they will continue to not have edit privileges. This is the default.
  • Grant edit privilegesAllows the user to edit the input datasets.
  • Revoke edit privilegesRemoves the user's edit privileges. The user may still view the input dataset.
String

Derived Output

LabelExplanationData Type
Updated Dataset

The updated dataset.

Layer; Table View; Dataset

arcpy.management.ChangePrivileges(in_dataset, user, {View}, {Edit})
NameExplanationData 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.

  • AS_ISNo change to the user's existing view privilege. If the user has view privileges, they will continue to have view privileges. If the user doesn't have view privileges, they will continue to not have view privileges.
  • GRANTAllows user to view datasets.
  • REVOKERemoves all user privileges to view datasets.
String
Edit
(Optional)

Establishes the user's edit privileges.

  • AS_IS No change to the user's existing edit privilege. If the user has edit privileges, they will continue to have edit privileges. If the user doesn't have edit privileges, they will continue to not have edit privileges. This is the default.
  • GRANTAllows the user to edit the input datasets.
  • REVOKERemoves the user's edit privileges. The user may still view the input dataset.
String

Derived Output

NameExplanationData Type
out_dataset

The updated 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

  • Basic: No
  • Standard: Yes
  • Advanced: Yes

Related topics