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
#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
30
31
32
|
# File 'app/components/marty/main_auth_app.rb', line 30
def self.has_scripting_perm?
has_perm?(:admin)
end
|
Instance Method Details
63
64
65
66
67
68
69
70
71
72
73
74
75
76
|
# File 'app/components/marty/main_auth_app.rb', line 63
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
128
129
130
|
# File 'app/components/marty/main_auth_app.rb', line 128
def app_moniker
warped ? 0x231B.chr('utf-8') : 0x03FB.chr('utf-8')
end
|
#app_title ⇒ Object
132
133
134
135
136
137
138
139
|
# File 'app/components/marty/main_auth_app.rb', line 132
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
|
93
94
95
96
97
98
99
100
101
102
103
104
105
|
# File 'app/components/marty/main_auth_app.rb', line 93
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
|
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
|
# File 'app/components/marty/main_auth_app.rb', line 107
def
[
{
text: 'Background Jobs',
icon_cls: 'fa fa-user-clock glyph',
disabled: !self.class.has_perm?(:admin),
menu: [
:bg_status,
:bg_stop,
:bg_restart,
:schedule_jobs_dashboard,
:schedule_jobs_logs,
]
},
]
end
|
#bg_command(subcmd) ⇒ Object
324
325
326
327
328
329
330
331
332
333
334
|
# File 'app/components/marty/main_auth_app.rb', line 324
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
|
148
149
150
|
# File 'app/components/marty/main_auth_app.rb', line 148
def
[]
end
|
141
142
143
144
145
146
|
# File 'app/components/marty/main_auth_app.rb', line 141
def
"<span style='color:#157fcc;
background-color:#{warped ? '#FBDF4F' : ''};
font-size:120%;
font-weight:bold;'>#{app_title}</span>"
end
|
49
50
51
52
53
54
55
56
57
58
59
60
61
|
# File 'app/components/marty/main_auth_app.rb', line 49
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
|
152
153
154
155
156
157
158
159
160
161
162
163
|
# File 'app/components/marty/main_auth_app.rb', line 152
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
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
|
# File 'app/components/marty/main_auth_app.rb', line 34
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
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
# File 'app/components/marty/main_auth_app.rb', line 78
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
124
125
126
|
# File 'app/components/marty/main_auth_app.rb', line 124
def warped
Marty::Util.warped?
end
|