Project Hierarchy module

Is it really scary? It's all performed in the same Postgresql transaction, which is automatically rolled back if the permission test fails. Also note that the test is performed twice - both before and after the write (the first one checks if the user has permissions to change the fields at all, the second one ensures the object wasn't changed beyond those permissions).