I am developing a redmine Plugin which has the task to offer some additional allow/disallow options, one of the features should be that the admin can allow/disallow the access to issue reports for everly role.
The Problem is that even if you try to redefine the permissions defined in redmine.rb in your plugins init.rb the permissions are merged, this leads to the fact that there is another permission (included in :view_issues
) that allows access to issue reports.
How can I Override the permission defined in redmine.rb using my Plugins init.rb
My Plugins init.rb:
Redmine::Plugin.register :report_roles do
name 'Report Roles plugin'
author 'Author name'
description 'This is a plugin for Redmine'
version '0.0.1'
url 'http://example.com/path/to/plugin'
author_url 'http://example.com/about'
Redmine::AccessControl.map do |map|
map.project_module :issue_tracking do |map|
map.permission :generate_issue_reports, {:reports => [:issue_report,:issue_report_details ]},:read => true
end
end
end
And the relevant parts of my redmine.rb:
...
map.project_module :issue_tracking do |map|
# Issue categories
map.permission :manage_categories, {:projects => :settings, :issue_categories => [:index, :show, :new, :create, :edit, :update, :destroy]}, :require => :member
# Issues
map.permission :view_issues, {:issues => [:index, :show],
:auto_complete => [:issues],
:context_menus => [:issues],
:versions => [:index, :show, :status_by],
:journals => [:index, :diff],
:queries => :index,
:reports => [:issue_report, :issue_report_details]},
:read => true
end
...
:reports => [:issue_report, :issue_report_details]
(included in :view_issues) also allows access to issue reports, I just want to "remove" the permission from :issue_views
and make them an extra permission, because the :view_issues
permission should be left enabled!
I also tried to redefine :view_issues
in my init.rb, but that had no effect.