Created
June 26, 2014 16:00
-
-
Save madzhuga/97ede93b713bc9f05845 to your computer and use it in GitHub Desktop.
Sample plugin from red mine
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Rails.logger.info 'Starting Example plugin for RedMine' | |
Redmine::Plugin.register :sample_plugin do | |
name 'Example plugin' | |
author 'Author name' | |
description 'This is a sample plugin for Redmine' | |
version '0.0.1' | |
settings :default => {'sample_setting' => 'value', 'foo'=>'bar'}, :partial => 'settings/sample_plugin_settings' | |
# This plugin adds a project module | |
# It can be enabled/disabled at project level (Project settings -> Modules) | |
project_module :example_module do | |
# A public action | |
permission :example_say_hello, {:example => [:say_hello]}, :public => true | |
# This permission has to be explicitly given | |
# It will be listed on the permissions screen | |
permission :example_say_goodbye, {:example => [:say_goodbye]} | |
# This permission can be given to project members only | |
permission :view_meetings, {:meetings => [:index, :show]}, :require => :member | |
end | |
# A new item is added to the project menu | |
menu :project_menu, :sample_plugin, { :controller => 'example', :action => 'say_hello' }, :caption => 'Sample' | |
# Meetings are added to the activity view | |
activity_provider :meetings | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment