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:
artoscinote 2023-08-21 12:19:28 +02:00 committed by GitHub
commit 6f5ef60ab1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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