Update permission handling
Add edit into index
Update db for different environment