Dont show edit buttons if the user is not allowed to edit

Closes #596