hides the create new inventory button for non admin users [fixes SCI-2296]

This commit is contained in:
zmagod 2018-04-13 13:39:58 +02:00
parent 0815111cae
commit bef166ff30
3 changed files with 14 additions and 9 deletions

View file

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

View file

@ -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
%>
<div class="jumbotron text-center" style="margin-top:25%">
<div class="jumbotron text-center" style="margin-top:18%">
<strong><%=t 'libraries.index.no_libraries.text' %></strong>
<h2><strong><%=t 'libraries.index.no_libraries.title' %><strong></h2>
<br />
<%= 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) %>
<h2><strong><%=t 'libraries.index.no_libraries.title' %><strong></h2>
<br />
<%= 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 %>
<h2><strong><%=t 'libraries.index.no_libraries.no_permission_title' %><strong></h2>
<% end %>
</div>
<% else %>
<!-- If member of no teams -->

View file

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