jbox-web/redmine_git_hosting — pull request #98 by bberawk (2013-11-05 16:36:40+00:00)
Title: Use "View Changesets" permission to determine repo read access

When checking if a user has read access to a repository the :view_changesets permission is used. To be specific, this is done in the Smart HTTP controller (`app/controllers/smart_http_controller.rb`) and in the Gitolite admin handler class (`lib/githosting/gitolite_redmine.rb`)

This permission isn't used everywhere. This PR, makes it so that the `:view_changesets` permission is used throughout the plugin.

I have made changes to 3 components so that they make use of the `:view_changesets` permission

- URL boxes are only shown if the current user has the `:view_changesets` permission.
- Users don't get shown git instructions for new projects unless they have the `:view_changesets` permission.
- When determining if the repo should have anonymous read access the Smart HTTP controller checks if the anonymous user has the `:view_changesets` permissions instead of checking if the project is public.

These changes add two benefits
- prevent user confusion. Before, if a user didn't have access to a repository, they could still be shown url boxes and instructions that would lead them to think that they have access to the repository.
- gives administrators more control over how repositories are accessed.