Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Newer
Older
100644 164 lines (145 sloc) 8.878 kB
603e11d @jplang Merged 0.6 branch into trunk.
jplang authored
1 require 'redmine/access_control'
2 require 'redmine/menu_manager'
a774c5c @jplang Activity refactoring.
jplang authored
3 require 'redmine/activity'
8614c00 @jplang Text files can now be viewed online when browsing the repository.
jplang authored
4 require 'redmine/mime_type'
a6311a9 @jplang Estimated time recognizes improved time formats (#1092).
jplang authored
5 require 'redmine/core_ext'
824a67a @jplang Added basic Theme support.
jplang authored
6 require 'redmine/themes'
f7acdd1 @jplang Merged hooks branch @ r1785 into trunk.
jplang authored
7 require 'redmine/hook'
e4f0864 @jplang Basic plugin support.
jplang authored
8 require 'redmine/plugin'
a3b9a5a @jplang Makes wiki text formatter pluggable.
jplang authored
9 require 'redmine/wiki_formatting'
438161a @jplang Added basic support for CVS and Mercurial SCMs.
jplang authored
10
edba1f6 @jplang Gantt chart can now be exported to a graphic file (png).
jplang authored
11 begin
eb371db @jplang Fixed: RMagick not loaded on case sensitive filesystems.
jplang authored
12 require_library_or_gem 'RMagick' unless Object.const_defined?(:Magick)
edba1f6 @jplang Gantt chart can now be exported to a graphic file (png).
jplang authored
13 rescue LoadError
14 # RMagick is not available
15 end
16
e69b464 @jplang Adds Filesystem adapter (patch #1393 by Paul R).
jplang authored
17 REDMINE_SUPPORTED_SCM = %w( Subversion Darcs Mercurial Cvs Bazaar Git Filesystem )
603e11d @jplang Merged 0.6 branch into trunk.
jplang authored
18
19 # Permissions
20 Redmine::AccessControl.map do |map|
5009652 @jplang Removed ProjectsController#feeds. This view was incomplete and incons…
jplang authored
21 map.permission :view_project, {:projects => [:show, :activity]}, :public => true
603e11d @jplang Merged 0.6 branch into trunk.
jplang authored
22 map.permission :search_project, {:search => :index}, :public => true
23 map.permission :edit_project, {:projects => [:settings, :edit]}, :require => :member
21c97c6 @jplang Added project module concept.
jplang authored
24 map.permission :select_project_modules, {:projects => :modules}, :require => :member
25 map.permission :manage_members, {:projects => :settings, :members => [:new, :edit, :destroy]}, :require => :member
603e11d @jplang Merged 0.6 branch into trunk.
jplang authored
26 map.permission :manage_versions, {:projects => [:settings, :add_version], :versions => [:edit, :destroy]}, :require => :member
27
21c97c6 @jplang Added project module concept.
jplang authored
28 map.project_module :issue_tracking do |map|
29 # Issue categories
30 map.permission :manage_categories, {:projects => [:settings, :add_issue_category], :issue_categories => [:edit, :destroy]}, :require => :member
31 # Issues
8509cf8 @jplang ProjectsController#list_issues, #export_issues_csv and #export_issues…
jplang authored
32 map.permission :view_issues, {:projects => [:changelog, :roadmap],
33 :issues => [:index, :changes, :show, :context_menu],
3c44aac @jplang Added version details view accessible from the roadmap.
jplang authored
34 :versions => [:show, :status_by],
21c97c6 @jplang Added project module concept.
jplang authored
35 :queries => :index,
36 :reports => :issue_report}, :public => true
44ac1a0 @jplang ProjectsController#add_issue moved to IssuesController#new.
jplang authored
37 map.permission :add_issues, {:issues => :new}
5d2899e @jplang AttachmentsController now handles attachments deletion.
jplang authored
38 map.permission :edit_issues, {:issues => [:edit, :reply, :bulk_edit]}
987a5aa @jplang Anonymous users can now be allowed to create, edit, comment issues, c…
jplang authored
39 map.permission :manage_issue_relations, {:issue_relations => [:new, :destroy]}
5d2abb8 @jplang Adds a Reply link to each issue note (#739). Reply is pre-filled with…
jplang authored
40 map.permission :add_issue_notes, {:issues => [:edit, :reply]}
1c8cf4e @jplang Added the following permissions (#527, #585, #627):
jplang authored
41 map.permission :edit_issue_notes, {:journals => :edit}, :require => :loggedin
42 map.permission :edit_own_issue_notes, {:journals => :edit}, :require => :loggedin
4155c97 @jplang Issue list now supports bulk edit/move/delete (#563, #607). For now, …
jplang authored
43 map.permission :move_issues, {:issues => :move}, :require => :loggedin
21c97c6 @jplang Added project module concept.
jplang authored
44 map.permission :delete_issues, {:issues => :destroy}, :require => :member
45 # Queries
665497f @jplang Fixed: Manage pu(b)lic queries typo (Thomas Lecavelier).
jplang authored
46 map.permission :manage_public_queries, {:queries => [:new, :edit, :destroy]}, :require => :member
21c97c6 @jplang Added project module concept.
jplang authored
47 map.permission :save_queries, {:queries => [:new, :edit, :destroy]}, :require => :loggedin
48 # Gantt & calendar
2986afc @jplang Adds support for free ticket filtering and custom queries on Gantt ch…
jplang authored
49 map.permission :view_gantt, :issues => :gantt
586f4e3 @jplang Adds support for free ticket filtering and custom queries on Calendar.
jplang authored
50 map.permission :view_calendar, :issues => :calendar
a332e0a @jplang Adds permissions for viewing the watcher list and adding new watchers…
jplang authored
51 # Watchers
52 map.permission :view_issue_watchers, {}
53 map.permission :add_issue_watchers, {:watchers => :new}
21c97c6 @jplang Added project module concept.
jplang authored
54 end
55
56 map.project_module :time_tracking do |map|
57 map.permission :log_time, {:timelog => :edit}, :require => :loggedin
58 map.permission :view_time_entries, :timelog => [:details, :report]
993b60d @jplang Adds 2 permissions (closes #859):
jplang authored
59 map.permission :edit_time_entries, {:timelog => [:edit, :destroy]}, :require => :member
60 map.permission :edit_own_time_entries, {:timelog => [:edit, :destroy]}, :require => :loggedin
21c97c6 @jplang Added project module concept.
jplang authored
61 end
62
63 map.project_module :news do |map|
1ecef3a @jplang ProjectsController#add_news moved to NewsController#new.
jplang authored
64 map.permission :manage_news, {:news => [:new, :edit, :destroy, :destroy_comment]}, :require => :member
ad68a82 @jplang Moved ProjectsController#list_news to NewsController#index.
jplang authored
65 map.permission :view_news, {:news => [:index, :show]}, :public => true
987a5aa @jplang Anonymous users can now be allowed to create, edit, comment issues, c…
jplang authored
66 map.permission :comment_news, {:news => :add_comment}
21c97c6 @jplang Added project module concept.
jplang authored
67 end
68
69 map.project_module :documents do |map|
5d2899e @jplang AttachmentsController now handles attachments deletion.
jplang authored
70 map.permission :manage_documents, {:documents => [:new, :edit, :destroy, :add_attachment]}, :require => :loggedin
8e00f57 @jplang Moved ProjectsController#list_documents and add_document to Documents…
jplang authored
71 map.permission :view_documents, :documents => [:index, :show, :download]
21c97c6 @jplang Added project module concept.
jplang authored
72 end
73
74 map.project_module :files do |map|
5d2899e @jplang AttachmentsController now handles attachments deletion.
jplang authored
75 map.permission :manage_files, {:projects => :add_file}, :require => :loggedin
21c97c6 @jplang Added project module concept.
jplang authored
76 map.permission :view_files, :projects => :list_files, :versions => :download
77 end
78
79 map.project_module :wiki do |map|
80 map.permission :manage_wiki, {:wikis => [:edit, :destroy]}, :require => :member
81 map.permission :rename_wiki_pages, {:wiki => :rename}, :require => :member
82 map.permission :delete_wiki_pages, {:wiki => :destroy}, :require => :member
455abea @jplang Adds a permission 'view wiki edits' so that wiki history can be hidde…
jplang authored
83 map.permission :view_wiki_pages, :wiki => [:index, :special]
84 map.permission :view_wiki_edits, :wiki => [:history, :diff, :annotate]
ccbe48d @jplang Adds 'Delete wiki pages attachments' permission.
jplang authored
85 map.permission :edit_wiki_pages, :wiki => [:edit, :preview, :add_attachment]
5d2899e @jplang AttachmentsController now handles attachments deletion.
jplang authored
86 map.permission :delete_wiki_pages_attachments, {}
0476669 @jplang Wiki page protection (#851, patch #1146 by Mateo Murphy with slight c…
jplang authored
87 map.permission :protect_wiki_pages, {:wiki => :protect}, :require => :member
21c97c6 @jplang Added project module concept.
jplang authored
88 end
89
90 map.project_module :repository do |map|
79c33bb @jplang Maps repository users to Redmine users (#1383).
jplang authored
91 map.permission :manage_repository, {:repositories => [:edit, :committers, :destroy]}, :require => :member
8c65cc4 @jplang Added Annotate/Blame view for Subversion, CVS and Mercurial repositor…
jplang authored
92 map.permission :browse_repository, :repositories => [:show, :browse, :entry, :annotate, :changes, :diff, :stats, :graph]
21c97c6 @jplang Added project module concept.
jplang authored
93 map.permission :view_changesets, :repositories => [:show, :revisions, :revision]
cc643ce @jplang Merged nbc branch @ r1812 (commit access permission and reposman impr…
jplang authored
94 map.permission :commit_access, {}
21c97c6 @jplang Added project module concept.
jplang authored
95 end
96
97 map.project_module :boards do |map|
98 map.permission :manage_boards, {:boards => [:new, :edit, :destroy]}, :require => :member
99 map.permission :view_messages, {:boards => [:index, :show], :messages => [:show]}, :public => true
bfd0fb0 @jplang Adds posts quoting functionality (#1825).
jplang authored
100 map.permission :add_messages, {:messages => [:new, :reply, :quote]}
29b3614 @jplang Forums enhancements:
jplang authored
101 map.permission :edit_messages, {:messages => :edit}, :require => :member
7a05f8e @jplang Adds permissions to let users edit and/or delete their messages (#854…
jplang authored
102 map.permission :edit_own_messages, {:messages => :edit}, :require => :loggedin
29b3614 @jplang Forums enhancements:
jplang authored
103 map.permission :delete_messages, {:messages => :destroy}, :require => :member
7a05f8e @jplang Adds permissions to let users edit and/or delete their messages (#854…
jplang authored
104 map.permission :delete_own_messages, {:messages => :destroy}, :require => :loggedin
21c97c6 @jplang Added project module concept.
jplang authored
105 end
603e11d @jplang Merged 0.6 branch into trunk.
jplang authored
106 end
107
c5d9985 @jplang The following menus can now be extended by plugins: top_menu, account…
jplang authored
108 Redmine::MenuManager.map :top_menu do |menu|
546b98a @jplang Adds a css class on menu items in order to apply item specific styles…
jplang authored
109 menu.push :home, :home_path
110 menu.push :my_page, { :controller => 'my', :action => 'page' }, :if => Proc.new { User.current.logged? }
111 menu.push :projects, { :controller => 'projects', :action => 'index' }, :caption => :label_project_plural
112 menu.push :administration, { :controller => 'admin', :action => 'index' }, :if => Proc.new { User.current.admin? }, :last => true
113 menu.push :help, Redmine::Info.help_url, :last => true
c5d9985 @jplang The following menus can now be extended by plugins: top_menu, account…
jplang authored
114 end
115
116 Redmine::MenuManager.map :account_menu do |menu|
546b98a @jplang Adds a css class on menu items in order to apply item specific styles…
jplang authored
117 menu.push :login, :signin_path, :if => Proc.new { !User.current.logged? }
118 menu.push :register, { :controller => 'account', :action => 'register' }, :if => Proc.new { !User.current.logged? && Setting.self_registration? }
119 menu.push :my_account, { :controller => 'my', :action => 'account' }, :if => Proc.new { User.current.logged? }
120 menu.push :logout, :signout_path, :if => Proc.new { User.current.logged? }
c5d9985 @jplang The following menus can now be extended by plugins: top_menu, account…
jplang authored
121 end
122
123 Redmine::MenuManager.map :application_menu do |menu|
124 # Empty
125 end
126
d771847 @jplang Pluggable admin menu (patch #2031 by Yuki Sonoda with slight changes).
jplang authored
127 Redmine::MenuManager.map :admin_menu do |menu|
128 # Empty
129 end
130
603e11d @jplang Merged 0.6 branch into trunk.
jplang authored
131 Redmine::MenuManager.map :project_menu do |menu|
c5d9985 @jplang The following menus can now be extended by plugins: top_menu, account…
jplang authored
132 menu.push :overview, { :controller => 'projects', :action => 'show' }
133 menu.push :activity, { :controller => 'projects', :action => 'activity' }
12c0f5f @jplang Do not show Roadmap menu item if the project doesn't define any versi…
jplang authored
134 menu.push :roadmap, { :controller => 'projects', :action => 'roadmap' },
c5d9985 @jplang The following menus can now be extended by plugins: top_menu, account…
jplang authored
135 :if => Proc.new { |p| p.versions.any? }
0faa456 @jplang Highlight the current item of the main menu.
jplang authored
136 menu.push :issues, { :controller => 'issues', :action => 'index' }, :param => :project_id, :caption => :label_issue_plural
16e9ffc @jplang Added a 'New issue' link in the main menu (accesskey 7).
jplang authored
137 menu.push :new_issue, { :controller => 'issues', :action => 'new' }, :param => :project_id, :caption => :label_issue_new,
138 :html => { :accesskey => Redmine::AccessKeys.key_for(:new_issue) }
0faa456 @jplang Highlight the current item of the main menu.
jplang authored
139 menu.push :news, { :controller => 'news', :action => 'index' }, :param => :project_id, :caption => :label_news_plural
140 menu.push :documents, { :controller => 'documents', :action => 'index' }, :param => :project_id, :caption => :label_document_plural
141 menu.push :wiki, { :controller => 'wiki', :action => 'index', :page => nil },
c5d9985 @jplang The following menus can now be extended by plugins: top_menu, account…
jplang authored
142 :if => Proc.new { |p| p.wiki && !p.wiki.new_record? }
0faa456 @jplang Highlight the current item of the main menu.
jplang authored
143 menu.push :boards, { :controller => 'boards', :action => 'index', :id => nil }, :param => :project_id,
144 :if => Proc.new { |p| p.boards.any? }, :caption => :label_board_plural
145 menu.push :files, { :controller => 'projects', :action => 'list_files' }, :caption => :label_attachment_plural
146 menu.push :repository, { :controller => 'repositories', :action => 'show' },
c5d9985 @jplang The following menus can now be extended by plugins: top_menu, account…
jplang authored
147 :if => Proc.new { |p| p.repository && !p.repository.new_record? }
7b8a4fc @jplang Menu mapper: add support for :before, :after and :last options to #pu…
jplang authored
148 menu.push :settings, { :controller => 'projects', :action => 'settings' }, :last => true
603e11d @jplang Merged 0.6 branch into trunk.
jplang authored
149 end
a774c5c @jplang Activity refactoring.
jplang authored
150
151 Redmine::Activity.map do |activity|
152 activity.register :issues, :class_name => %w(Issue Journal)
153 activity.register :changesets
154 activity.register :news
155 activity.register :documents, :class_name => %w(Document Attachment)
156 activity.register :files, :class_name => 'Attachment'
455abea @jplang Adds a permission 'view wiki edits' so that wiki history can be hidde…
jplang authored
157 activity.register :wiki_edits, :class_name => 'WikiContent::Version', :default => false
a774c5c @jplang Activity refactoring.
jplang authored
158 activity.register :messages, :default => false
159 end
a3b9a5a @jplang Makes wiki text formatter pluggable.
jplang authored
160
161 Redmine::WikiFormatting.map do |format|
162 format.register :textile, Redmine::WikiFormatting::Textile::Formatter, Redmine::WikiFormatting::Textile::Helper
163 end
Something went wrong with that request. Please try again.