I was wondering if there is any way to protect fields so that users cannot delete or edit them. With that being said, a 'superuser' would need to be able to edit and delete at will.
working in python with arcpy; arcgis 10.3
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It only takes a minute to sign up.Sign up to join this community
When creating a field in a FGDB, you can mark it as
required which will not allow you to delete it.
>>> gdb = arcpy.CreateFileGDB_management('C:/temp', 'temp') >>> table = arcpy.CreateTable_management(gdb, 'table') >>> arcpy.AddField_management(table, 'a', field_is_required=True) >>> arcpy.DeleteField_management(table, 'a') Runtime error Traceback (most recent call last): File "<string>", line 1, in <module> File "c:\program files (x86)\arcgis\desktop10.2\arcpy\arcpy\management.py", line 3479, in DeleteField raise e ExecuteError: Failed to execute. Parameters are not valid. ERROR 001334: Cannot delete required field a Failed to execute (DeleteField).
From the help on
Fields set as required are permanent and you will not be able to delete them with future processing. To allow for deletion at a later time set the field to non-required (the default).