Bug #13920
closedUnable to view config reports in forman 1.11 rc1 as non admin user
Added by Chuck Schweizer almost 9 years ago. Updated over 6 years ago.
Description
If a non admin user attempts to view a report in foreman 1.11 rc1 the following error is displayed.
ConfigReport not found Please try to update your request
Updated by Shlomi Zadok almost 9 years ago
Does that user have the permission to view config reports?
In the role filter ensure that Resource type -> Config reports, view config reports is enabled for that user role.
Updated by Chuck Schweizer almost 9 years ago
Yes I made sure that the user's role had view config reports. Initially the role did not have this permission and the user did not even see the Config reports menu item. After adding the "view config reports" filter the menu appeared but this error is received when attempting to view a report.
This foreman server was upgraded from 1.10.0.
Shlomi Zadok wrote:
Does that user have the permission to view config reports?
In the role filter ensure that Resource type -> Config reports, view config reports is enabled for that user role.
Updated by Dominic Cleal almost 9 years ago
- Category set to Users, Roles and Permissions
- Translation missing: en.field_release set to 71
If you could enable permissions and SQL debug logging and upload the log while accessing the page as a non-admin user, that would provide useful data: http://theforeman.org/manuals/1.11/index.html#7.2Debugging
Updated by Chuck Schweizer almost 9 years ago
Here is the output.
Updated by Chuck Schweizer almost 9 years ago
This configuration has no proxy servers. Foreman is just being used as a reporting backend at this time.
Updated by Dominic Cleal almost 9 years ago
Could you try running foreman-rake fix_db_cache
to rebuild the DB cache of users versus their roles?
Strange that the menu is visible but the page isn't working, but it's possible the former doesn't use the DB cache and that's causing it. The two should obviously be consistent.
Did you provide the view_config_reports permission by adding it to an existing role, adding another role to the user or how exactly?
Updated by Chuck Schweizer almost 9 years ago
foreman-rake fix_db_cache did not change anything.
The issue I see is that (permissions.resource_type = 'Report') and it should be (permissions.resource_type = 'ConfigReport')
2016-02-29 14:46:10 [sql] [D] Filter Load (1.8ms) SELECT "filters".* FROM "filters" INNER JOIN "filterings" ON "filterings"."filter_id" = "filters"."id" INNER JOIN "permissions" ON "permissions"."id" = "filterings"."permission_id" INNER JOIN "roles" ON "filters"."role_id" = "roles"."id" INNER JOIN "cached_user_roles" ON "roles"."id" = "cached_user_roles"."role_id" WHERE "cached_user_roles"."user_id" = $1 AND (permissions.resource_type = 'Report') AND (permissions.name = 'view_config_reports') ORDER BY filters.role_id, filters.id [["user_id", 65]]
Updated by Chuck Schweizer almost 9 years ago
Here is the example output by changing Report to ConfigReport
foreman=# SELECT "filters".* FROM "filters" INNER JOIN "filterings" ON "filterings"."filter_id" = "filters"."id" INNER JOIN "permissions" ON "permissions"."id" = "filterings"."permission_id" INNER JOIN "roles" ON "filters"."role_id" = "roles"."id" INNER JOIN "cached_user_roles" ON "roles"."id" = "cached_user_roles"."role_id" WHERE "cached_user_roles"."user_id" = '65' AND (permissions.resource_type = 'Report') AND (permissions.name = 'view_config_reports') ORDER BY filters.role_id, filters.id ; id | search | role_id | created_at | updated_at | taxonomy_search ----+--------+---------+------------+------------+----------------- (0 rows) foreman=# SELECT "filters".* FROM "filters" INNER JOIN "filterings" ON "filterings"."filter_id" = "filters"."id" INNER JOIN "permissions" ON "permissions"."id" = "filterings"."permission_id" INNER JOIN "roles" ON "filters"."role_id" = "roles"."id" INNER JOIN "cached_user_roles" ON "roles"."id" = "cached_user_roles"."role_id" WHERE "cached_user_roles"."user_id" = '65' AND (permissions.resource_type = 'ConfigReport') AND (permissions.name = 'view_config_reports') ORDER BY filters.role_id, filters.id ; id | search | role_id | created_at | updated_at | taxonomy_search -----+--------+---------+---------------------------+---------------------------+----------------- 121 | | 10 | 2016-02-29 14:01:04.56838 | 2016-02-29 14:01:04.56838 | (1 row)
Updated by Dominic Cleal almost 9 years ago
- Related to Feature #4151: Add STI to reports and allow for registering new report types added
Updated by Dominic Cleal almost 9 years ago
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
Updated by Dominic Cleal almost 9 years ago
- Is duplicate of Bug #13545: Editing template throws "undefined method `profile=' for nil:NilClass" error added
Updated by Dominic Cleal almost 9 years ago
The fix for #13545 fixes this too, leaving this open for now.
Updated by Chuck Schweizer almost 9 years ago
I confirmed this fixes the issue on my foreman server. Thanks,
Updated by Justin Sherrill almost 9 years ago
- Status changed from Assigned to Closed
Applied in changeset 640d7ee703ae347ee9dd5c21e341cb4d6a9874ec.