diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb index 089236873..63fec7c2b 100644 --- a/app/controllers/repositories_controller.rb +++ b/app/controllers/repositories_controller.rb @@ -299,7 +299,7 @@ class RepositoriesController < ApplicationController end def check_view_all_permissions - render_403 unless can_view_team_repositories(@team) + render_403 unless can_read_team?(@team) end def check_view_permissions diff --git a/app/helpers/permission_helper.rb b/app/helpers/permission_helper.rb index d99612d20..42ed10b0d 100644 --- a/app/helpers/permission_helper.rb +++ b/app/helpers/permission_helper.rb @@ -1042,9 +1042,9 @@ module PermissionHelper # ---- REPOSITORIES PERMISSIONS ---- - def can_view_team_repositories(team) - is_member_of_team(team) - end + # def can_view_team_repositories(team) + # is_member_of_team(team) + # end def can_create_repository(team) is_admin_of_team(team) && diff --git a/app/permissions/team.rb b/app/permissions/team.rb index a74f66a79..8ddd159ab 100644 --- a/app/permissions/team.rb +++ b/app/permissions/team.rb @@ -1,5 +1,6 @@ Canaid::Permissions.register_for(Team) do - # view projects, view protocols, view samples, export samples + # view projects, view protocols + # view samples, export samples, view repositories can :read_team do |user, team| user.is_member_of_team?(team) end diff --git a/app/views/shared/_secondary_navigation.html.erb b/app/views/shared/_secondary_navigation.html.erb index 6761b6eb0..1824d3b92 100644 --- a/app/views/shared/_secondary_navigation.html.erb +++ b/app/views/shared/_secondary_navigation.html.erb @@ -192,7 +192,7 @@ <% end %> - <% if can_view_team_repositories(@my_module.experiment.project.team) && + <% if can_read_team?(@my_module.experiment.project.team) && @my_module.experiment.project.team.repositories.exists? %>