Hide share button for users with one team (#2005)

This commit is contained in:
aignatov-bio 2019-08-23 11:29:03 +02:00 committed by GitHub
parent 5515bac773
commit 96e132c62e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -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

View file

@ -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>