ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • Help
  • Sign Out
ArcGIS Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS Desktop

A complete professional GIS

ArcGIS Enterprise

GIS in your enterprise

ArcGIS Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

ArcMap

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • Extensions

Change Privileges

  • Summary
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

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.

Syntax

arcpy.management.ChangePrivileges(in_dataset, user, {View}, {Edit})
ParameterExplanationData 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_IS —No 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 —Allows user to view datasets.
  • REVOKE —Removes 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.
  • GRANT —Allows the user to edit the input datasets.
  • REVOKE —Removes 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

  • Current Workspace

Licensing information

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

Related topics

  • An overview of the Geodatabase Administration toolset

ArcGIS Desktop

  • Home
  • Documentation
  • Support

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Esri Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
Copyright © 2021 Esri. | Privacy | Legal