mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
Merge pull request #1027 from okriuchykhin/ok_SCI_2163
Hide delete button for guest users in repository [SCI-2163]
This commit is contained in:
commit
e0834a57cf
2 changed files with 14 additions and 8 deletions
|
@ -52,6 +52,11 @@ Canaid::Permissions.register_for(Team) do
|
|||
user.is_normal_user_or_admin_of_team?(team)
|
||||
end
|
||||
|
||||
# repository: update/delete records
|
||||
can :manage_repository_rows do |user, team|
|
||||
user.is_normal_user_or_admin_of_team?(team)
|
||||
end
|
||||
|
||||
# repository: create field
|
||||
can :create_repository_columns do |user, team|
|
||||
user.is_normal_user_or_admin_of_team?(team)
|
||||
|
|
|
@ -115,14 +115,15 @@
|
|||
<span class="hidden-xs-custom"><%= t("repositories.edit_record") %></span>
|
||||
</button>
|
||||
|
||||
<!-- Don't check if user can manage the selected repository records, because the ones that he can't, will be left untouched -->
|
||||
<button type="button" class="btn btn-default"
|
||||
id="deleteRepositoryRecordsButton" data-target="#deleteRepositoryRecord" data-toggle="modal" disabled>
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
<span class="hidden-xs-custom"><%= t'repositories.delete_record' %></span>
|
||||
<%= submit_tag I18n.t('repositories.delete_record'), :class => "hidden
|
||||
delete_repository_records_submit" %>
|
||||
</button>
|
||||
<% if can_manage_repository_rows?(repository.team) %>
|
||||
<button type="button" class="btn btn-default"
|
||||
id="deleteRepositoryRecordsButton" data-target="#deleteRepositoryRecord" data-toggle="modal" disabled>
|
||||
<span class="glyphicon glyphicon-trash"></span>
|
||||
<span class="hidden-xs-custom"><%= t'repositories.delete_record' %></span>
|
||||
<%= submit_tag I18n.t('repositories.delete_record'), :class => "hidden
|
||||
delete_repository_records_submit" %>
|
||||
</button>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= render partial: "repositories/repository_table.html.erb",
|
||||
|
|
Loading…
Reference in a new issue