lock method to lock a node if it is currently unlocked.unlock method to unlock a node if it is currently locked by the same user.upgrade method to lock a node and unlock all its descendants if the node is unlocked, has at least one locked descendant, and no locked ancestors.upgrade method, traverse the tree upwards to check for locked ancestors and downwards to check for locked descendants.