Skip to content

Instantly share code, notes, and snippets.

@meineerde
Created May 3, 2010 13:39
Show Gist options
  • Save meineerde/388097 to your computer and use it in GitHub Desktop.
Save meineerde/388097 to your computer and use it in GitHub Desktop.
require 'redmine'
Redmine::Plugin.register :my_plugin do
[...]
project_module :my_module do
permission :read_my_stuff, :my_controller => [:first_action, :second_action]
end
end
class MyController < ApplicationController
unloadable
before_filter :find_project
before_filter :authorize
def first_action
# only entered if user has read_my_stuff permission and the project has the module my_module enabled
[...]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment