Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Simplify permission to check if Admin is shown in menu

Klaus Zanderse9b646d4c2dc
diff --git a/config/initializers/menus.rb b/config/initializers/menus.rb
index f7d8206a506..e887dd6fb6a 100644
--- a/config/initializers/menus.rb
+++ b/config/initializers/menus.rb
@@ -118,10 +118,7 @@ Redmine::MenuManager.map :account_menu do |menu|
menu.push :administration,
{ controller: '/admin', action: 'index' },
if: Proc.new {
- User.current.allowed_globally?(:create_backup) ||
- User.current.allowed_globally?(:manage_placeholder_user) ||
- User.current.allowed_globally?(:manage_user) ||
- User.current.allowed_globally?(:create_user)
+ User.current.allowed_globally?({ controller: '/admin', action: 'index' })
}
menu.push :logout,
:signout_path,
@@ -351,7 +348,7 @@ Redmine::MenuManager.map :admin_menu do |menu|
{ controller: '/attribute_help_texts' },
caption: :'attribute_help_texts.label_plural',
icon: 'help2',
- if: Proc.new { User.current.admin? },
+ if: Proc.new { User.current.allowed_globally?(:edit_attribute_help_texts) },
enterprise_feature: 'attribute_help_texts'
menu.push :enumerations,