Merge pull request #679 from okriuchykhin/ok_SCI_1345

Fix repository view permissions for team guests [SCI-1345]
This commit is contained in:
okriuchykhin 2017-06-13 15:47:44 +02:00 committed by GitHub
commit 97a94ff4a3
2 changed files with 2 additions and 6 deletions

View file

@ -1058,12 +1058,8 @@ module PermissionHelper
team.repositories.count < Constants::REPOSITORIES_LIMIT
end
def can_view_repositories(team)
is_normal_user_or_admin_of_team(team)
end
def can_view_repository(repository)
is_normal_user_or_admin_of_team(repository.team)
is_member_of_team(repository.team)
end
def can_edit_and_destroy_repository(repository)

View file

@ -188,7 +188,7 @@
</a>
</li>
<% end %>
<% if can_view_repositories(@my_module.experiment.project.team) &&
<% if can_view_team_repositories(@my_module.experiment.project.team) &&
@my_module.experiment.project.team.repositories.exists? %>
<li id="repositories-nav-tab" class="<%= "active" if module_repository_page? %>">
<a href="#" id="repositoriesDropdownMenuLink" title="<%=t "nav2.modules.repositories" %>" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">