User Permissions

Programmatically there are no restrictions on what you can do. However you may want to restrict the actions that your users may perform.


The simplest restriction is to set Diagram.IsEnabled to false. Users will not be able to do much of anything.

  // Disable the diagram!
  diagram.IsEnabled = false;


More common is to set Diagram.IsReadOnly to true. This allows users to scroll and zoom and to select parts, but not to insert or delete or drag or modify parts. (If you want to allow scroll and zoom but not selection, you can disable selection, as discussed below.)

  // Disable diagram modifications, but allow navigation and selection
  diagram.IsReadOnly = true;


Another possibility is to set Model.IsReadOnly to true. This allows users to scroll, zoom, select, and move parts, but not to insert or delete parts, including not adding or removing links nor adding or removing group members.

The Diagram.IsModelReadOnly property just gets and sets the Model.IsReadOnly property. If you are loading new Models, you will need to set this Diagram property after setting Diagram.Model.

  // Disable adding or removing parts
  diagram.Model.IsReadOnly = true;

Allowing Collapse and Expand

One common situation with diagrams that are Diagram.IsReadOnly is that the user can not collapse or expand trees or subgraphs. Instead of setting Diagram.IsReadOnly, you can set these properties:

  palette.IsReadOnly = false;
  palette.IsModelReadOnly = false;
  palette.AllowDelete = false;
  palette.AllowInsert = false;
  palette.AllowLink = false;
  palette.AllowMove = false;
  palette.AllowTextEdit = false;
  // maybe other Diagram.Allow... properties too, depending on your templates
  // also consider disabling Tools
  palette.ToolManager.ContextMenuTool.IsEnabled = false;

Specific permissions

More precise restrictions on the user can be imposed by setting properties of the Diagram or of a particular Layer or of a particular Part or GraphObject.

Some restrictions, such as Diagram.AllowZoom, only make sense when applying to the whole diagram. Others may also apply to individual parts, such as Part.Copyable and Layer.AllowCopy corresponding to Diagram.AllowCopy. Finally some may apply to any GraphObject, for example properties for ports such as GraphObject.ToLinkable, or to text objects such as TextBlock.Editable.

Any Tool can be disabled by setting Tool.IsEnabled to false. By default all Tools are enabled, but many cannot run because the conditions are not right for Tool.CanStart to return true.

Here is a listing of what users can do and the properties that limit that functionality. Most of these properties have a default value of true.

Cut command (CommandHandler)

Copy command (CommandHandler)

Paste command (CommandHandler)

Delete command (CommandHandler)

Drag-and-drop within diagram (DraggingTool)

Drag-and-drop out of diagram (DraggingTool)

Drag-and-drop into diagram (DraggingTool)

In-place text editing (TextEditingTool)

Group command (CommandHandler)

Ungroup command (CommandHandler)

Click-creating (ClickCreatingTool)

Resizing an object (ResizingTool)

Rotating an object (RotatingTool)

Arrow and Page commands (CommandHandler), panning/scrolling the diagram (PanningTool and scrollbars)

SelectAll command (CommandHandler), click selecting (ClickSelectingTool), drag selecting (DragSelectingTool)

Undo/Redo commands (CommandHandler)

Zoom commands (CommandHandler), zooming/rescaling the diagram (ToolManager)

Context Menus (ContextMenuTool)