DRM – How to prevent users from deleting and removing Nodes


In this example, we prevent users removing leaf nodes but not limbs. The logic should be altered to suit requirements.
1. If necessary, create a version, hierarchy and a top node. Add a couple of limb nodes under the top node, one of which is given a leaf node or two.
2. Create a property called IsLeaf. Make it String, inheritable, Local node level, derived.
3. Select the Property Params tab and enter the formula If( IsLeaf(), True, False ) [Change this bit to suit your requirements – if they are as simple as this, you could, of course, use the Leaf property in 6 below instead]
4. Select the Category tab and add it to a convenient property category. Choose OK.

5. Create a validation called StopRemove: level Remove (not Node or Global Node!), class StrPropEqual.
6. Set parameters IsLeaf = True. Save.
7. Select Properties tab and add property IsLeaf to a convenient property category. Save.

8. Open the hierarchy, select the top node, press F11 (properties).
9. Verify that IsLeaf property shows False for limbs and True for leaves
10. In the Version Control Window, right click the hierarchy and choose Assign -> Validation…
11. Select StopRemove (tick it). Choose OK.

12. Test:
Right click a Leaf node and choose Remove. You should receive the standard warning, followed by a dialog box saying the leaf failed the StopRemove validation.
Right click a childless limb node and choose Delete. Removal is permitted.

Please drop email or let me know in case of any issues.

Thanks,
~KKT~

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s