diff --git a/app/services/toolbars/projects_service.rb b/app/services/toolbars/projects_service.rb index 98594b3c1..a653a1f34 100644 --- a/app/services/toolbars/projects_service.rb +++ b/app/services/toolbars/projects_service.rb @@ -13,6 +13,7 @@ module Toolbars @project_folders = current_user.current_team.project_folders.where(id: project_folder_ids) @items = @projects + @project_folders + @not_assigned = @projects.any? { |project| !project.assigned_users.include?(current_user) } @single = @items.length == 1 @@ -29,6 +30,7 @@ module Toolbars def actions return [] if @item_type == :none + return [access_action] if @not_assigned [ restore_action, diff --git a/app/views/projects/index/_project_actions_dropdown.html.erb b/app/views/projects/index/_project_actions_dropdown.html.erb index 2c88b534c..fea1ba0d6 100644 --- a/app/views/projects/index/_project_actions_dropdown.html.erb +++ b/app/views/projects/index/_project_actions_dropdown.html.erb @@ -3,98 +3,112 @@ <% project_form = f %> <%= f.hidden_field :archived, value: !project.archived %> <% end %> + +<% assigned = project.assigned_users.include?(current_user) %>