moved permission and menu entries from costs plugin to reporting plugin - added global accessable menu entry

git-svn-id: https://dev.finn.de/svn/cockpit/branches/reporting_merge@1085 7926756e-e54e-46e6-9721-ed318f58905e
pull/6827/head
p.tessenow 15 years ago
parent 8c26e356e7
commit 55dff38b2c
  1. 27
      init.rb

@ -9,4 +9,31 @@ Redmine::Plugin.register :redmine_reporting do
requires_redmine :version_or_higher => '0.9'
requires_redmine_plugin :redmine_costs, :version_or_higher => '0.3'
#register reporting_module including permissions
project_module :reporting_module do #todo: refactor this to be the reporting_module
#require_or_load 'costs_access_control_permission_patch'
permission :view_cost_entries, {:costlog => [:details], :cost_reports => [:index, :get_filter]}
permission :view_own_cost_entries, {:costlog => [:details], :cost_reports => [:index, :get_filter]},
:granular_for => :view_cost_entries
end
# register additional permissions for the time log
project_module :time_tracking do
permission :view_own_time_entries, {:timelog => [:details, :report], :cost_reports => [:index, :get_filter]},
:granular_for => :view_time_entries
end
#menu extensions
menu :top_menu, :cost_reports, {:controller => 'cost_reports', :action => 'index'},
:caption => :cost_reports_title,
:if => Proc.new {
( User.current.allowed_to?(:view_cost_objects, nil, :global => true) ||
User.current.allowed_to?(:edit_cost_objects, nil, :global => true)
)
}
menu :project_menu, :cost_reports, {:controller => 'cost_reports', :action => 'index'},
:param => :project_id, :after => :cost_objects, :caption => :cost_reports_title
end

Loading…
Cancel
Save