Fix repository view permissions for team guests [SCI-1345]

This commit is contained in:
Oleksii Kriuchykhin 2017-06-13 10:33:08 +02:00
parent f3f1a68070
commit 2d693a3fb7
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">