diff --git a/app/controllers/repositories_controller.rb b/app/controllers/repositories_controller.rb
index cb8bd4d09..d40f032c2 100644
--- a/app/controllers/repositories_controller.rb
+++ b/app/controllers/repositories_controller.rb
@@ -9,7 +9,7 @@ class RepositoriesController < ApplicationController
before_action :check_manage_permissions, only:
%i(destroy destroy_modal rename_modal update)
before_action :check_create_permissions, only:
- %i(create_new_modal create copy_modal copy)
+ %i(create_modal create copy_modal copy)
layout 'fluid'
diff --git a/app/views/repositories/index.html.erb b/app/views/repositories/index.html.erb
index c9001ad32..91159aaef 100644
--- a/app/views/repositories/index.html.erb
+++ b/app/views/repositories/index.html.erb
@@ -6,15 +6,19 @@
# show only if no repositories present. If the team will have them we will
# handle this in left side navigation bar
%>
-
+
<%=t 'libraries.index.no_libraries.text' %>
-
<%=t 'libraries.index.no_libraries.title' %>
-
- <%= link_to t('libraries.index.no_libraries.create_new_button'),
- create_modal_team_repositories_path(current_team),
- class: "btn btn-primary btn-lg",
- id: "create-new-repository",
- remote: true %>
+ <% if can_create_repositories?(current_team) %>
+ <%=t 'libraries.index.no_libraries.title' %>
+
+ <%= link_to t('libraries.index.no_libraries.create_new_button'),
+ create_modal_team_repositories_path(current_team),
+ class: "btn btn-primary btn-lg",
+ id: "create-new-repository",
+ remote: true %>
+ <% else %>
+ <%=t 'libraries.index.no_libraries.no_permission_title' %>
+ <% end %>
<% else %>
diff --git a/config/locales/en.yml b/config/locales/en.yml
index 2621e0a95..efb2a7dde 100644
--- a/config/locales/en.yml
+++ b/config/locales/en.yml
@@ -1026,6 +1026,7 @@ en:
index:
head_title: "Inventories"
no_libraries:
+ no_permission_title: "You don't have permission to create new inventory. Please contact your team administrator."
text: "You don't have any inventories."
title: "Please create your first Inventory"
create_new_button: "Create New Inventory"