Remove empty 'else' block
Test preview link's context
Add the correct context to the preview link
Test that user w/o permission get no commit link
Render commit link for users with permissions only