It is a programmer responsibility to check model modification permissions before doing model changes. Some Elements in model can be read-only, but API does not prevent modifications of these elements.
The Element is read-only if:
Use com.nomagic.magicdraw.uml.BaseElement.isEditable() to check if Element's properties can be changed.
Editing permissions should be checked if primitive Element properties are modified (like a name, for example) or references are modified (like a Property type).
Check the adding permission if you are going to modify some containment property (like Element.ownedElement).
Use BaseElement.canAddChild() to check if children can be added into the Element.
Use BaseElement.canAdd(com.nomagic.magicdraw.uml.BaseElement) to check if a parent can own a given element and a parent has permissions to own. This method will fail, for example, if you will try to add an Operation into a Package.
Use BaseElement.isEditable() to check if an Element can be removed (disposed) from the model.
The moving permission is similar to the adding permission, but checks more conditions.
Use com.nomagic.magicdraw.uml.permissions.ElementPermissionsManager.addPermissionsHandler(ElementPermissions) to register a custom element permissions handler. Using this API you can handle custom rules for putting a permission on the top of some specific elements.