Project

General

Profile

Actions

Bug #20817

closed

Taxonomies of role filter are not updating through Hammer CLI

Added by Daniel Lobato Garcia about 7 years ago. Updated almost 7 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
Users and roles
Target version:
-
Difficulty:
Triaged:
Team Backlog:
Fixed in Releases:
Found in Releases:
In Kanboard:

Description

Description of problem:
Updating role to override the "filter with taxonomies" is broken. Taxonomies are not getting assigned to overridden filter.

How reproducible:
Always

Steps to Reproduce:
1. Create Role
2. Add filter(overridden/non-overridden) to the above role
3. From hammer CLI, attempt to update filter (with/without override flag and) assign some taxonomies

Commands:
#hammer filter update --id 493 --role-id 42 --override yes --organization-ids "1,3" --location-ids "2,4"
-> Permission filter for [Subnet] updated

Actual results:
1. The filter is set to overridden which is expected
2. Taxonomies of role filters are not updated

Expected results:
Taxonomies of role filter should be updated

Note:
This but is reproducible in both the cases when updating filter which is "not overridden or already overriden".

Logs:
/var/log/foreman/production.log:

2017-08-29 04:41:16 1eaba8c3 [app] [I] Started GET "/api/filters/493" for 10.16.4.58 at 2017-08-29 04:41:16 -0400
2017-08-29 04:41:16 1eaba8c3 [app] [I] Processing by Api::V2::FiltersController#show as JSON
2017-08-29 04:41:16 1eaba8c3 [app] [I] Parameters: {"apiv"=>"v2", "id"=>"493", "filter"=>{}}
2017-08-29 04:41:16 1eaba8c3 [app] [I] Current user: foreman_admin (administrator)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Current user: foreman_admin (administrator)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Authorized user admin(Admin User)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Rendered api/v2/filters/show.json.rabl (11.7ms)
2017-08-29 04:41:16 1eaba8c3 [app] [I] Completed 200 OK in 46ms (Views: 11.4ms | ActiveRecord: 20.8ms)
2017-08-29 04:41:16 93e37b81 [app] [I] Started PUT "/api/filters/493" for 10.16.4.58 at 2017-08-29 04:41:16 -0400
2017-08-29 04:41:16 93e37b81 [app] [I] Processing by Api::V2::FiltersController#update as JSON
2017-08-29 04:41:16 93e37b81 [app] [I] Parameters: {"filter"=>{"role_id"=>42, "organization_ids"=>[], "location_ids"=>[]}, "apiv"=>"v2", "id"=>"493"}
2017-08-29 04:41:16 93e37b81 [app] [I] Current user: foreman_admin (administrator)
2017-08-29 04:41:16 93e37b81 [app] [I] Current user: foreman_admin (administrator)
2017-08-29 04:41:16 93e37b81 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:16 93e37b81 [app] [I] Authorized user admin(Admin User)
2017-08-29 04:41:16 93e37b81 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:16 93e37b81 [app] [I] Rendered api/v2/filters/update.json.rabl (5.6ms)
2017-08-29 04:41:16 93e37b81 [app] [I] Completed 200 OK in 48ms (Views: 6.3ms | ActiveRecord: 10.3ms)
2017-08-29 04:41:17 eb5c0b42 [app] [I] Started GET "/notification_recipients" for 10.76.33.235 at 2017-08-29 04:41:17 -0400
2017-08-29 04:41:17 eb5c0b42 [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-08-29 04:41:17 eb5c0b42 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:17 eb5c0b42 [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.7ms)
2017-08-29 04:41:27 9d7a7ee1 [app] [I] Started GET "/notification_recipients" for 10.76.33.235 at 2017-08-29 04:41:27 -0400
2017-08-29 04:41:27 9d7a7ee1 [app] [I] Processing by NotificationRecipientsController#index as JSON
2017-08-29 04:41:27 9d7a7ee1 [app] [I] Current user: admin (administrator)
2017-08-29 04:41:27 9d7a7ee1 [app] [I] Completed 200 OK in 4ms (Views: 0.1ms | ActiveRecord: 0.4ms)


Related issues 1 (0 open1 closed)

Related to Hammer CLI - Bug #20117: Switching filter to overriding one erases assigned taxonomiesClosedTomáš Strachota06/27/2017Actions
Actions #1

Updated by Marek Hulán almost 7 years ago

  • Subject changed from Taxonomies of role filter are not updating through Hammer CLI to Taxonomies of role filter are not updating through Hammer CLI
  • Status changed from New to Resolved

No longer reproducible, fixed by #20117

Actions #2

Updated by Marek Hulán almost 7 years ago

  • Related to Bug #20117: Switching filter to overriding one erases assigned taxonomies added
Actions

Also available in: Atom PDF