Class: Marty::MainAuthApp
Constant Summary
Constants included
from Permissions
Permissions::NETZKE_ENDPOINTS
Extras::Misc::MM_OPTIONS
Class Method Summary
collapse
Instance Method Summary
collapse
can_call_endpoint?, can_perform_action?, can_perform_actions, current_user_roles, extended, has_any_perm?, has_marty_permissions, has_perm?
#icon_hack, numberfield_cfg, #sep
Methods inherited from AuthApp
#configure, #current_user_menu_item, #notification_menu_item, #unread_notifications_count, #user_menu
Methods inherited from SimpleApp
#configure, #js_component_html, #js_component_render, #main_panel_config, #menu_bar_config, #status_bar_config
#root_sess
Class Method Details
.has_posting_perm? ⇒ Boolean
set of posting types user is allowed to post with
.has_scripting_perm? ⇒ Boolean
33
34
35
|
# File 'app/components/marty/main_auth_app.rb', line 33
def self.has_scripting_perm?
has_perm?(:admin)
end
|
Instance Method Details
66
67
68
69
70
71
72
73
74
75
76
77
78
79
|
# File 'app/components/marty/main_auth_app.rb', line 66
def
[
{
text: 'API Management',
icon_cls: 'fa fa-fighter-jet glyph',
disabled: !self.class.has_perm?(:admin),
menu: [
:api_auth_view,
:api_config_view,
:api_log_view,
]
}
]
end
|
#app_moniker ⇒ Object
166
167
168
|
# File 'app/components/marty/main_auth_app.rb', line 166
def app_moniker
warped ? 0x231B.chr('utf-8') : 0x03FB.chr('utf-8')
end
|
#app_title ⇒ Object
170
171
172
173
174
175
176
177
|
# File 'app/components/marty/main_auth_app.rb', line 170
def app_title
e = ENV['RAILS_ENV']
title = "#{app_moniker} #{::Marty::RailsApp.application_name.titleize}"
title += " - #{e.capitalize}" unless e == 'production'
title += ' [TIME WARPED]' if warped
title
end
|
114
115
116
117
118
119
120
121
122
123
124
125
126
|
# File 'app/components/marty/main_auth_app.rb', line 114
def
{
text: I18n.t('applications'),
icon_cls: 'fa fa-window-restore glyph',
menu: [
:data_grid_view,
:data_grid_user_view,
:reporting,
:scripting,
:promise_view,
],
}
end
|
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
|
# File 'app/components/marty/main_auth_app.rb', line 128
def
[
{
text: 'Background Jobs',
icon_cls: 'fa fa-user-clock glyph',
disabled: !self.class.has_perm?(:admin),
menu: [
:bg_status,
:bg_stop,
:bg_restart,
:delayed_jobs_grid,
:schedule_jobs_dashboard,
:schedule_jobs_logs,
]
},
]
end
|
#bg_command(subcmd) ⇒ Object
396
397
398
399
400
401
402
403
404
405
406
|
# File 'app/components/marty/main_auth_app.rb', line 396
def bg_command(subcmd)
params = Marty::Config['DELAYED_JOB_PARAMS'] || ''
e, root, p = ENV['RAILS_ENV'], Rails.root, Marty::Config['RUBY_PATH']
dj_path = Marty::Config['DELAYED_JOB_PATH'] || 'bin/delayed_job'
cmd = "export RAILS_ENV=#{e};"
cmd += "export PATH=#{p}:$PATH;" if p
cmd += "#{root}/#{dj_path} #{subcmd} #{params} 2>&1"
cmd
end
|
186
187
188
|
# File 'app/components/marty/main_auth_app.rb', line 186
def
[]
end
|
179
180
181
182
183
184
|
# File 'app/components/marty/main_auth_app.rb', line 179
def
"<span style='color:#157fcc;
background-color:#{warped ? '#FBDF4F' : ''};
font-size:120%;
font-weight:bold;'>#{app_title}</span>"
end
|
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'app/components/marty/main_auth_app.rb', line 52
def
[
{
text: 'Log Maintenance',
icon_cls: 'fa fa-wrench glyph',
disabled: !(self.class.has_perm?(:admin) || self.class.has_perm?(:dev)),
menu: [
:log_view,
:log_cleanup,
]
}
]
end
|
190
191
192
193
194
195
196
197
198
199
200
201
|
# File 'app/components/marty/main_auth_app.rb', line 190
def
return super unless self.class.has_any_perm?
[, sep] +
(self.class.has_perm?(:admin) || self.class.has_perm?(:dev) ||
self.class.has_perm?(:user_manager) ? [, sep] : []) +
+
[
, sep,
, sep,
] + super
end
|
81
82
83
84
85
86
87
88
89
90
91
92
|
# File 'app/components/marty/main_auth_app.rb', line 81
def
[
{
text: 'Miscellaneous Views',
icon_cls: 'fa fa-window-restore glyph',
disabled: !self.class.has_perm?(:admin),
menu: [
:show_env,
],
},
]
end
|
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
|
# File 'app/components/marty/main_auth_app.rb', line 146
def
disabled = !(self.class.has_perm?(:admin) ||
self.class.has_perm?(:user_manager))
[
{
text: 'Notifications',
icon_cls: 'fa fa-bell glyph',
disabled: disabled,
menu: [
:notifications_config_view,
:notifications_deliveries_view,
]
},
]
end
|
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
# File 'app/components/marty/main_auth_app.rb', line 37
def
{
text: warped ? Marty::Util.get_posting.name.to_s : I18n.t('postings'),
name: 'posting',
tooltip: 'Postings',
icon_cls: 'fa fa-clock glyph',
style: (warped ? 'background-color: lightGrey;' : ''),
menu: [
:new_posting,
:select_posting,
:select_now,
],
}
end
|
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
|
# File 'app/components/marty/main_auth_app.rb', line 94
def
{
text: I18n.t('system'),
icon_cls: 'fa fa-wrench glyph',
style: '',
menu: [
:import_type_view,
:user_view,
:config_view,
:reload_scripts,
:load_seed,
] +
+
+
+
+
}
end
|
#warped ⇒ Object
162
163
164
|
# File 'app/components/marty/main_auth_app.rb', line 162
def warped
Marty::Util.warped?
end
|