mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-29 11:45:18 +08:00
refactor view repositories permission
This commit is contained in:
parent
3ca51f097f
commit
740ecc674b
4 changed files with 7 additions and 6 deletions
|
@ -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
|
||||
|
|
|
@ -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) &&
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -192,7 +192,7 @@
|
|||
</a>
|
||||
</li>
|
||||
<% 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? %>
|
||||
<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">
|
||||
|
|
Loading…
Reference in a new issue