**Source URL:** https://limited.veevavault.dev/clinical/security/tree/how-to-enable-tree-security.md

# How to Enable Tree Security

You can enable tree security on an object by setting a value for the `security_tree_object` and `tree_assignment_object_name` attributes with the Vault API’s [Execute MDL Script](/vault-api/api-reference/26.2/metadata-definition-language-mdl/execute-mdl-script) endpoint. You can also execute MDL commands with [Vault Toolbox](/mdl/documentation/guides/vault-toolbox).

For example, the following code enables tree security on the `campaign__c` custom object:

```
ALTER Object campaign__c ( 
   security_tree_object('Object.security_tree__c'),
   tree_assignment_object_name('user_tree_assignment')
);

```


---

**Previous:** [Understanding Tree Security](/clinical/security/tree/understanding-tree-security)  
**Next:** [How to Create, Edit, & Update Security Trees](/clinical/security/tree/how-to-crud-tree-security)