mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-09-21 07:26:15 +08:00
Hide share button for users with one team (#2005)
This commit is contained in:
parent
5515bac773
commit
96e132c62e
|
@ -346,7 +346,7 @@ class RepositoriesController < ApplicationController
|
|||
end
|
||||
|
||||
def check_share_permissions
|
||||
render_403 unless can_share_repository?(@repository)
|
||||
render_403 if !can_share_repository?(@repository) || current_user.teams.count <= 1
|
||||
end
|
||||
|
||||
def repository_params
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
|
||||
<div id="datatables-buttons" class="datatables-buttons" style="display: inline;">
|
||||
<div class="new-repository-button">
|
||||
<% if can_share_repository?(@repository) %>
|
||||
<% if can_share_repository?(@repository) && current_user.teams.count > 1 %>
|
||||
<%= link_to team_repository_share_modal_path(current_team, repository_id: @repository),
|
||||
class: 'btn btn-default share-repo-option', remote: true, id: 'shareRepoBtn' do %>
|
||||
<span class="fas fa-user-plus"></span>
|
||||
|
|
Loading…
Reference in a new issue