Project

General

Profile

Bug #24158

Unable to clone Organization admin role

Added by Marek Hulán about 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
-
Target version:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Cloned from https://bugzilla.redhat.com/show_bug.cgi?id=1597505

Description of problem:

Version-Release number of selected component (if applicable):
Build: Satellite 6.4 snap 10

How reproducible:
Always

Steps to Reproduce:
1. Go to roles
2. Clone Organization Admin role
3. Give a name to the new role, hit submit

From API end:
2018-07-02 16:45:25 - nailgun.client - DEBUG - Making HTTP GET request to https://sat-host/api/v2/roles with options {'data': '{"search": "name=\\"Organization admin\\""}', 'auth': ('admin', 'changeme'), 'verify': False, 'headers': {'content-type': 'application/json'}}, no params and no data.
2018-07-02 16:45:25 - nailgun.client - DEBUG - Received HTTP 200 response: {
"total": 37,
"subtotal": 1,
"page": 1,
"per_page": 20,
"search": "name=\"Organization admin\"",
"sort": {
"by": "name",
"order": "ASC"
},
"results": [{"builtin":0,"cloned_from_id":null,"name":"Organization admin","id":26,"description":null,"origin":"foreman"}]
}

2018-07-02 16:45:25 - nailgun.client - DEBUG - Making HTTP POST request to https://sat-host/api/v2/roles/26/clone with options {'auth': ('admin', 'changeme'), 'verify': False, 'headers': {'content-type': 'application/json'}}, no params and data {"role": {"name": "CnFoWBhmaC", "organization_ids": [71], "location_ids": [74]}}.
2018-07-02 16:45:32 - nailgun.client - WARNING - Received HTTP 422 response: {
"error": {"id":null,"errors":{"filters.permissions":["You must select at least one permission"]},"full_messages":["Permissions You must select at least one permission"]}
}

Actual results:
Nothing Happens, You stay on the same page

Expected results:

Additional info:

Associated revisions

Revision f968c042 (diff)
Added by Marek Hulán about 1 year ago

Fixes #24158 - fix cloning of roles

Roles that contains filters without permissions could not be cloned. In
UI, user did not even get any error message, API responded with 422 at
least.

History

#1 Updated by Marek Hulán about 1 year ago

  • Priority changed from High to Normal
  • Subject changed from Unable to clone Organization admin role to Unable to clone Organization admin role

#2 Updated by Marek Hulán about 1 year ago

  • Legacy Backlogs Release (now unused) set to 330
  • Assignee set to Marek Hulán

this makes cloning of roles unusable when there's a filter without permissions (e.g. plugins removed some permissions), the easy solution is to ignore empty filters on clone, long term (after branching) we should think of cleaning such filters

I propose to 1.18.0 or 1.18.1 if the fix won't make it in on time, please reset if you disagree

#3 Updated by The Foreman Bot about 1 year ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5775 added

#4 Updated by Marek Hulán about 1 year ago

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

#5 Updated by The Foreman Bot about 1 year ago

  • Pull request https://github.com/theforeman/foreman/pull/5788 added

Also available in: Atom PDF