Skip to content

Commit

Permalink
Remove activity menu for anonymous users with login required
Browse files Browse the repository at this point in the history
  • Loading branch information
top4ek committed Nov 29, 2024
1 parent c86e0c6 commit c5cf9d5
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 6 deletions.
1 change: 1 addition & 0 deletions config/initializers/menus.rb
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
menu.push :activity,
{ controller: "/activities", action: "index" },
context: :modules,
if: Proc.new { User.current.logged? || !Setting.login_required? },
icon: "history"

menu.push :work_packages,
Expand Down
2 changes: 2 additions & 0 deletions lib/redmine/menu_manager/top_menu_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,8 @@ def more_top_menu_items

def module_top_menu_item_groups
items = more_top_menu_items
return items if items.empty?

item_groups = []

# add untitled group, if no heading is present
Expand Down
6 changes: 0 additions & 6 deletions spec/features/menu_items/top_menu_item_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,12 +138,6 @@ def click_link_in_open_menu(title)
context "as an anonymous user" do
let(:user) { create(:anonymous) }

context "when login_required", with_settings: { login_required: true } do
it "redirects to login" do
expect(page).to have_current_path /login/
end
end

context "when not login_required", with_settings: { login_required: false } do
it "displays only projects, activity and news" do
has_menu_items? project_item, activity_item, news_item
Expand Down

0 comments on commit c5cf9d5

Please sign in to comment.