mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-12-25 01:03:18 +08:00
Merge pull request #5733 from G-Chubinidze/gc_SCI_8727
Project card permission with not assigned team admin [SCI-8727]
This commit is contained in:
commit
6f5ef60ab1
1 changed files with 5 additions and 1 deletions
|
@ -16,6 +16,9 @@ module Toolbars
|
|||
|
||||
@single = @items.length == 1
|
||||
|
||||
@team_owner = @current_user.current_team.user_assignments.exists?(user: @current_user, user_role: UserRole.find_predefined_owner_role)
|
||||
@unassigned_team_owner = @team_owner && !can_read_project?(@items.first)
|
||||
|
||||
@item_type = if project_ids.blank? && project_folder_ids.blank?
|
||||
:none
|
||||
elsif project_ids.present? && project_folder_ids.present?
|
||||
|
@ -29,6 +32,7 @@ module Toolbars
|
|||
|
||||
def actions
|
||||
return [] if @item_type == :none
|
||||
return [access_action] if @unassigned_team_owner
|
||||
|
||||
[
|
||||
restore_action,
|
||||
|
@ -84,7 +88,7 @@ module Toolbars
|
|||
|
||||
project = @items.first
|
||||
|
||||
return unless can_read_project?(project)
|
||||
return unless @team_owner || can_read_project?(project)
|
||||
|
||||
path = if can_manage_project_users?(project)
|
||||
edit_access_permissions_project_path(project)
|
||||
|
|
Loading…
Reference in a new issue