now checks for permission when updating and deleting objects, remove orphaned permissions automatically