Fix edit permission checking