Project

General

Profile

Bug #10132

User assigned 'viewer' role causes httpd 500 internal error when browsing Foreman UI

Added by J C over 6 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Low
Assignee:
-
Category:
-
Target version:
Difficulty:
Triaged:
Yes
Bugzilla link:
Fixed in Releases:
Found in Releases:

Description

I created a new user. Assigned the 'viewer' role. After login, browsing off the dashboard page causes the following:

2015-04-14 13:59:15 [I] Processing by DashboardController#index as HTML
2015-04-14 13:59:15 [I] Rendered dashboard/welcome.html.erb within layouts/application (18.0ms)
2015-04-14 13:59:15 [I] Rendered home/_user_dropdown.html.erb (3.0ms)
2015-04-14 13:59:15 [I] Read fragment views/tabs_and_title_records-4 (0.1ms)
2015-04-14 13:59:15 [I] Rendered home/_topbar.html.erb (168.0ms)
2015-04-14 13:59:15 [I] Rendered layouts/base.html.erb (170.6ms)
2015-04-14 13:59:15 [I] Filter chain halted as :welcome rendered or redirected
2015-04-14 13:59:15 [I] Completed 200 OK in 231ms (Views: 207.4ms | ActiveRecord: 4.2ms)
2015-04-14 13:59:19 [I] Processing by Katello::DashboardController#index as HTML
2015-04-14 13:59:19 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/common/_helptip_button.html.haml (0.1ms)
2015-04-14 13:59:19 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/common/_helptip.html.haml (0.0ms)
2015-04-14 13:59:19 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/dashboard/index.html.haml within katello/layouts/katello (9.9ms)
2015-04-14 13:59:19 [I] Completed 500 Internal Server Error in 41ms
2015-04-14 13:59:19 [F]
NameError (undefined local variable or method `anonymous_admin' for #<User:0x0000000afeaf60>):
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

Associated revisions

Revision 394e5beb (diff)
Added by Eric Helms over 6 years ago

Fixes #10132: Allow viewer role to view content dashboard.

This was previously changed form hidden to anonymous_admin, however,
when we switch to using the hidden administrators for backend operations
we only needed to check whether the user as an admin since the hidden
users are all admins.

Revision aaebc0c7
Added by Eric Helms over 6 years ago

Merge pull request #5176 from ehelms/fixes-10132

Fixes #10132: Allow viewer role to view content dashboard.

History

#1 Updated by Eric Helms over 6 years ago

  • Triaged changed from No to Yes

#2 Updated by J C over 6 years ago

J C wrote:

I created a new user. Assigned the 'viewer' role. After login, browsing off the dashboard page causes the following:

2015-04-14 13:59:15 [I] Processing by DashboardController#index as HTML
2015-04-14 13:59:15 [I] Rendered dashboard/welcome.html.erb within layouts/application (18.0ms)
2015-04-14 13:59:15 [I] Rendered home/_user_dropdown.html.erb (3.0ms)
2015-04-14 13:59:15 [I] Read fragment views/tabs_and_title_records-4 (0.1ms)
2015-04-14 13:59:15 [I] Rendered home/_topbar.html.erb (168.0ms)
2015-04-14 13:59:15 [I] Rendered layouts/base.html.erb (170.6ms)
2015-04-14 13:59:15 [I] Filter chain halted as :welcome rendered or redirected
2015-04-14 13:59:15 [I] Completed 200 OK in 231ms (Views: 207.4ms | ActiveRecord: 4.2ms)
2015-04-14 13:59:19 [I] Processing by Katello::DashboardController#index as HTML
2015-04-14 13:59:19 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/common/_helptip_button.html.haml (0.1ms)
2015-04-14 13:59:19 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/common/_helptip.html.haml (0.0ms)
2015-04-14 13:59:19 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/dashboard/index.html.haml within katello/layouts/katello (9.9ms)
2015-04-14 13:59:19 [I] Completed 500 Internal Server Error in 41ms
2015-04-14 13:59:19 [F]
NameError (undefined local variable or method `anonymous_admin' for #<User:0x0000000afeaf60>):
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

I think the upgrade I did just before was the cause. When I removed the updates, listed below, the new user operates as expected.

---> Package foreman-release.noarch 0:1.8.0-0.1.RC2.el6 will be updated
---> Package foreman-release.noarch 0:1.8.0-0.1.RC3.el6 will be an update
---> Package mod_passenger.x86_64 0:4.0.18-9.7.el6 will be updated
---> Package mod_passenger.x86_64 0:4.0.18-9.8.el6 will be an update
---> Package ruby193-rubygem-passenger.x86_64 0:4.0.18-9.7.el6 will be updated
---> Package ruby193-rubygem-passenger.x86_64 0:4.0.18-9.8.el6 will be an update
---> Package ruby193-rubygem-passenger-native.x86_64 0:4.0.18-9.7.el6 will be updated
---> Package ruby193-rubygem-passenger-native.x86_64 0:4.0.18-9.8.el6 will be an update
---> Package ruby193-rubygem-passenger-native-libs.x86_64 0:4.0.18-9.7.el6 will be updated
---> Package ruby193-rubygem-passenger-native-libs.x86_64 0:4.0.18-9.8.el6 will be an update
---> Package rubygem-passenger.x86_64 0:4.0.18-9.7.el6 will be updated
---> Package rubygem-passenger.x86_64 0:4.0.18-9.8.el6 will be an update
---> Package rubygem-passenger-native.x86_64 0:4.0.18-9.7.el6 will be updated
---> Package rubygem-passenger-native.x86_64 0:4.0.18-9.8.el6 will be an update
---> Package rubygem-passenger-native-libs.x86_64 0:4.0.18-9.7.el6 will be updated
---> Package rubygem-passenger-native-libs.x86_64 0:4.0.18-9.8.el6 will be an update

Perhaps we should close this, and I can open a new bug if needed (after more testing)?

#3 Updated by J C over 6 years ago

OK, I got a similar message from another new user (with the 'manager' role) - still with the updates not applied.

2015-04-14 15:11:13 [I] Processing by Katello::DashboardController#index as HTML
2015-04-14 15:11:13 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/common/_helptip_button.html.haml (0.1ms)
2015-04-14 15:11:13 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/common/_helptip.html.haml (0.1ms)
2015-04-14 15:11:13 [I] Rendered /opt/rh/ruby193/root/usr/share/gems/gems/katello-2.3.0/app/views/katello/dashboard/index.html.haml within katello/layouts/katello (17.3ms)
2015-04-14 15:11:13 [I] Completed 500 Internal Server Error in 92ms
2015-04-14 15:11:13 [F]
NameError (undefined local variable or method `anonymous_admin' for #<User:0x007f86acf58108>):
app/controllers/concerns/application_shared.rb:13:in `set_timezone'
lib/middleware/catch_json_parse_errors.rb:9:in `call'

#4 Updated by The Foreman Bot over 6 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/Katello/katello/pull/5176 added
  • Pull request deleted ()

#5 Updated by Eric Helms over 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Christine Fouant over 6 years ago

  • Bugzilla link set to 1199408

#7 Updated by Christine Fouant over 6 years ago

  • Bugzilla link deleted (1199408)

#8 Updated by Christine Fouant over 6 years ago

  • Bugzilla link set to 1199408

Also available in: Atom PDF