mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-10-06 11:57:16 +08:00
Project card permission with not assigned team admin [SCI-8727] (#6045)
Fix project card action permission checks
This commit is contained in:
parent
9a38cbe578
commit
d3901bd96f
1 changed files with 105 additions and 91 deletions
|
@ -1,9 +1,22 @@
|
|||
<% project_form = nil %>
|
||||
<% project_form = nil
|
||||
unassigned_team_owner = can_manage_team?(current_user.current_team) && !can_read_project?(project)
|
||||
%>
|
||||
|
||||
<%= form_for project, format: :json, method: :put, remote: true, html: { id: "edit-project-dropdown-form-#{project.id}" } do |f| %>
|
||||
<% project_form = f %>
|
||||
<%= f.hidden_field :archived, value: !project.archived %>
|
||||
<% end %>
|
||||
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="projectActionsDropdown">
|
||||
<% if unassigned_team_owner %>
|
||||
<!-- Project members access -->
|
||||
<li class="form-dropdown-item">
|
||||
<%= link_to can_manage_project_users?(project) ? edit_access_permissions_project_path(project) : access_permissions_project_path(project),
|
||||
data: { action: 'remote-modal'} do %>
|
||||
<i class="sn-icon sn-icon-project-member-access"></i>
|
||||
<%= I18n.t('projects.index.project_members_access') %>
|
||||
<% end %>
|
||||
</li>
|
||||
<% else %>
|
||||
<!-- Restore project -->
|
||||
<% if project.archived? && can_restore_project?(project) %>
|
||||
<li class="form-dropdown-item">
|
||||
|
@ -97,4 +110,5 @@
|
|||
<span><%= t('projects.index.activities_option') %></span>
|
||||
</a>
|
||||
</li>
|
||||
<% end %>
|
||||
</ul>
|
||||
|
|
Loading…
Add table
Reference in a new issue