Bug #18855
closedRole clone API call fails for roles with some organizations/locations assigned
Description
- Create a user role assigned to some organizations and locations
- Try to clone the role with either api or hammer
Cloning roles without any taxonomies work fine.
Actual results:
The API call fails on validation of the cloned record:
[ERROR 2017-03-09T14:11:07 API] 422 Unprocessable Entity [DEBUG 2017-03-09T14:11:07 API] { "error" => { "id" => nil, "errors" => { "locations" => [ [0] "is invalid" ], "organizations" => [ [0] "is invalid" ] }, "full_messages" => [ [0] "Locations is invalid", [1] "Organizations is invalid" ] } }
In fact the original validation error comes from taxonomies:
you cannot remove organizations that are used by hosts or inherited
Active record hides the message with a generic one for validation errors on associations.
Expected results:
The role should be successfully cloned with all taxonomies set.
Updated by Tomáš Strachota over 7 years ago
- Related to Feature #18317: Clone role from API added
Updated by Marek Hulán over 7 years ago
I remember to see this before, isn't this caused by the fact the original role that you try to clone is already invalid? That was it in my case.
Updated by Marek Hulán over 7 years ago
- Target version changed from 1.12.1 to 1.12.3
Updated by Marek Hulán over 7 years ago
- Target version changed from 1.12.3 to 1.13.0
Updated by Marek Hulán over 7 years ago
- Target version changed from 1.13.0 to 1.13.2
Updated by Marek Hulán over 7 years ago
- Target version changed from 1.13.2 to 1.13.4
Updated by Tomáš Strachota over 7 years ago
The role seems to be valid and I'm able to clone it via UI. Api or hammer fails.
Updated by The Foreman Bot over 7 years ago
- Status changed from New to Ready For Testing
- Pull request https://github.com/theforeman/foreman/pull/4560 added
Updated by Marek Hulán over 7 years ago
- Target version changed from 1.13.4 to 1.14.0
Updated by Marek Hulán over 7 years ago
- Translation missing: en.field_release set to 266
Daniel, I think this would be also good in 1.15.2. It's not regression introduced in 1.15 but since one of areas that 1.15 is focused on is the delegation of administration for organizations, this would hit a lot of users. It's small and safe patch. As always, feel free to reset to 1.16 if you think otherwise.
Updated by Ondřej Pražák over 7 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset e620923c07f987b87f6c06299d961d97c184a9ff.
Updated by Tomer Brisker over 4 years ago
- Category changed from 218 to Users, Roles and Permissions