2

I have a requirement on the ongoing project to allow the tables to be accessed by only the users with right privileges. So I am looking for methods to disable adding tables to view programmatically. I know about looking for the standalone table getting added to StandAloneTable Collection but it is after the fact that user had tried to open the table by clicking the "Open Attribute Table" in right click context menu on the layer in TOC. But It would be good to disable the "Open Attribute Table" menu item instead of allowing user to click and find out.

Is there any way to disable the "Add Table" and "Open Attribute Table" menu items in TOC of ArcMap programmatically?

Here is the image of right click Context menu item, I want to disable.

Open Attribute Table Add Table

  • I'm not sure you can alter system menus in that manner. – Hornbydd Sep 23 '15 at 21:06
  • Even without ArcObjects Is there any setting that could be used to achieve this? – Rohit Sep 24 '15 at 15:27
1

Yes, you can do that, but you don't to use ArcObjects for this.

There was a similar question, which I have answered here.

In ArcMap, go to Customize menu > Customize Mode > Toolbars tab > tick Context Menus > in the Context Menus toolbar click drop-down list > go to Workspace item (you will need to scroll down by holding the mouse cursor on the "down" arrow for a while since it will be in the very end). Then you can delete the Add Table item.

enter image description here

If you would need to bring this item back, you can use the Customize menu again and find the Add Table and then drag-and-drop it to the Workspace context menu.

Esri help page: Adding a command to a shortcut menu

Keep in mind that these settings are stored per user so you may need to redistribute the UI layout settings across your users if you would need to. Look at the help page Fundamentals of saving your customizations.

1

Enforcing logic like this on the client application (particularly on a per user basis) makes no sense, it's so easy to work around, error prone and maintenance intensive. And it restricts users from using the application properly with data they do have full control over.

If you don't want users reading the data, don't grant them read access. Instead use a web service or a database view with very limited attributes and grant them access to that instead.

0

I agree with @Hornbydd when they say:

I'm not sure you can alter system menus in that manner.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.