From bd9f5c1cdae52edb6cb298708b3d5ec760b50253 Mon Sep 17 00:00:00 2001 From: Oleksii Kriuchykhin Date: Wed, 7 Mar 2018 13:41:57 +0100 Subject: [PATCH] Fix manage repository permissions [SCI-2136] --- app/permissions/team.rb | 2 +- app/views/repositories/_repository.html.erb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/permissions/team.rb b/app/permissions/team.rb index 86c9bf6cd..a54eefbc4 100644 --- a/app/permissions/team.rb +++ b/app/permissions/team.rb @@ -105,7 +105,7 @@ end Canaid::Permissions.register_for(Repository) do # repository: update, delete can :manage_repository do |user, repository| - can_create_repositories?(user, repository.team) + user.is_admin_of_team?(repository.team) end end diff --git a/app/views/repositories/_repository.html.erb b/app/views/repositories/_repository.html.erb index 432411aea..ee5fa4ea3 100644 --- a/app/views/repositories/_repository.html.erb +++ b/app/views/repositories/_repository.html.erb @@ -32,7 +32,7 @@ data-toggle="dropdown" aria-haspopup="true" aria-expanded="true" - <%= "disabled='disabled'" if !can_manage_repository?(repository) && !can_create_repositories?(repository.team) %>> + <%= "disabled='disabled'" unless can_manage_repository?(repository) || can_create_repositories?(repository.team) %>>