Plugin: Authorize action from patch
Added by Michael Fürmann almost 12 years ago
Hey there,
I try to extend the repository controller with a new view action following this article:
http://theadmin.org/articles/how-to-modify-core-redmine-classes-from-a-plugin/
module RedmineGitolite module Patches module RepositoriesControllerPatch unloadable def self.included(base) base.send(:include, InstanceMethods) end module InstanceMethods def git_info @project = Project.find_by_identifier(params[:id]) @repositories = @project.repositories @repository = @repositories.select{|r| r.identifier == params[:repository_id]}.first respond_to do |format| format.html # show.html.erb end end end end end end
In frontend I get a 403 error when accessing the route for this new action.
production.log shows me:Filter chain halted as :authorize rendered or redirected
So far ...
What is to do to authorize a user for this action?
Would be ok to allow all users with access to #show to view this page.
Replies (1)
RE: Plugin: Authorize action from patch - Added by keineahnung 2345 over 1 year ago
For later comers, you need https://www.redmine.org/projects/redmine/wiki/Plugin_Tutorial#Adding-new-permissions