Fix manage repository permissions [SCI-2136]

This commit is contained in:
Oleksii Kriuchykhin 2018-03-07 13:41:57 +01:00
parent cae726f5c3
commit bd9f5c1cda
2 changed files with 2 additions and 2 deletions

View file

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

View file

@ -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) %>>
<span class="glyphicon glyphicon-cog"></span>
<span class="caret"></span>
</div>