File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change 1
1
class GttConfigurationController < ApplicationController
2
2
3
+ before_action :find_optional_project_and_authorize
4
+
3
5
accept_api_auth :default_setting_configuration
4
6
5
7
def default_setting_configuration
@@ -13,7 +15,6 @@ def build_default_setting_config
13
15
default_tracker_icon = [ ]
14
16
default_status_color = [ ]
15
17
gtt_tile_source = [ ]
16
- tracker_project_ids = [ ]
17
18
18
19
Tracker . all . sort . each { |tracker |
19
20
default_tracker_icon . append ( {
@@ -29,7 +30,7 @@ def build_default_setting_config
29
30
color : Setting . plugin_redmine_gtt [ 'status_' +status . id . to_s ]
30
31
} )
31
32
}
32
- GttTileSource . all . sort . each { |tileSource |
33
+ GttTileSource . where ( global : true ) . sort . each { |tileSource |
33
34
gtt_tile_source . append ( {
34
35
id : tileSource . id ,
35
36
name : tileSource . name ,
@@ -55,8 +56,19 @@ def build_default_setting_config
55
56
geocoderOptions : Setting . plugin_redmine_gtt [ 'default_geocoder_options' ]
56
57
} ,
57
58
} ,
58
- gttLayer : gtt_tile_source
59
+ gttLayer : gtt_tile_source ,
59
60
}
60
61
return mapConfig
61
62
end
63
+
64
+ private
65
+
66
+ def find_optional_project_and_authorize
67
+ if params [ :project_id ]
68
+ @project = Project . find params [ :project_id ]
69
+ authorize
70
+ else
71
+ authorize_global
72
+ end
73
+ end
62
74
end
You can’t perform that action at this time.
0 commit comments