mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-26 09:42:46 +08:00
Merge pull request #1092 from ZmagoD/zd_SCI_2297
adds edit repository item permission to normal user [fixes SCI-2297]
This commit is contained in:
commit
8803a7ca15
2 changed files with 10 additions and 2 deletions
|
@ -58,4 +58,11 @@ module RepositoryDatatableHelper
|
|||
"<span class='circle disabled'> </span>"
|
||||
end
|
||||
end
|
||||
|
||||
def can_perform_repository_actions(repository)
|
||||
team = repository.team
|
||||
can_manage_repository?(repository) ||
|
||||
can_create_repositories?(team) ||
|
||||
can_manage_repository_rows?(team)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -20,11 +20,12 @@
|
|||
data-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="true"
|
||||
<%= "disabled" unless can_manage_repository?(@repository) || can_create_repositories?(@repository.team) %>>
|
||||
<%= "disabled" unless can_perform_repository_actions(@repository) %>>
|
||||
<span class="glyphicon glyphicon-cog"></span>
|
||||
<span class="caret"></span>
|
||||
</div>
|
||||
<% if can_manage_repository?(@repository) || can_create_repositories?(@repository.team) %>
|
||||
|
||||
<% if can_perform_repository_actions(@repository) %>
|
||||
<ul class="dropdown-menu pull-right">
|
||||
<li class="dropdown-header">
|
||||
<%= t("repositories.index.options_dropdown.header") %>
|
||||
|
|
Loading…
Reference in a new issue