Modify delete template tag to match audit logic

There was a bug on staging because these two different code paths treat UDFs differently. This problem is fixed by using the same test in the template tag that is used in the audit system.
Update delete button activation condition

Reads the correct permissions for tree when tree is the object to be deleted.