Bug 1378544

Summary: Unable to remove cloned built-in roles
Product: Red Hat Satellite Reporter: Brian Coca <brcoca>
Component: Users & RolesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED ERRATA QA Contact: Peter Ondrejka <pondrejk>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.2.1CC: abalakht, asahni, bbuckingham, bkearney, dhlavacd, kelly.brown1, lzap, marbet, mhulan, mjahangi, rankumar, sabnave, snemeth
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: foreman-1.11.0.72-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1417994 1426672 (view as bug list) Environment:
Last Closed: 2017-05-01 13:55:05 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1417994, 1426672    
Attachments:
Description Flags
roles-screenshot none

Description Brian Coca 2016-09-22 17:21:12 UTC
Description of problem:
Unable to remove cloned built-in roles

Version-Release number of selected component (if applicable):
Satellite 6.2.1

How reproducible:
Every time

Steps to Reproduce:

Through Web UI
1. Find built in role
2. Clone built in role
3. Delete cloned built-in role

Deleting through CLI
1.# hammer role list
2.# hammer role info --id <number>
Id:      <number>
Name:    IPM Patching User
Builtin: No
3.# hammer role delete --id <number> <---Cloned built-in roles
4.Could not delete the user roles:
  Can't delete built-in role

Actual results:
web UI: No option to delete.
CLI: Could not delete the user roles:
  Can't delete built-in role

Expected results:
Able to delete cloned built-in role

Additional info:

Comment 1 Brad Buckingham 2016-09-30 16:01:32 UTC
*** Bug 1379399 has been marked as a duplicate of this bug. ***

Comment 5 Robert Foreman 2016-10-06 13:08:06 UTC
Encountered in 6.2.2 as well.

Comment 7 Bryan Kearney 2016-10-06 18:05:01 UTC
Upstream bug component is Search

Comment 10 Bryan Kearney 2016-10-07 10:04:41 UTC
Upstream bug component is Provisioning

Comment 11 Bryan Kearney 2016-10-10 12:04:54 UTC
Upstream bug component is Search

Comment 13 Marek Hulan 2016-10-13 07:13:29 UTC
While testing, please also verify following from duplicate BZ

Using Web UI
1. select any built in role. for e.g "Default user"
2. Clone the selected role
3. Now Go to users -> Select any User ->  'Click on roles tab'
4. search for new role, we can see that new role is not available.


Version-Release number of selected component (if applicable): 6.2.2


How reproducible: Always


Actual results: Unable to assign builtin cloned role to user.
 

Expected results: We should be able to assign any cloned roles to user.

Comment 14 Marek Hulan 2016-10-13 07:13:52 UTC
*** Bug 1383999 has been marked as a duplicate of this bug. ***

Comment 15 Peter Ondrejka 2016-10-20 15:01:12 UTC
Created attachment 1212558 [details]
roles-screenshot

Comment 16 Peter Ondrejka 2016-10-20 15:03:14 UTC
Verified in Sat 6.3 snap 5, a role created by cloning a built-in role can now be successfully removed both via UI or hammer.

Also, such cloned role is available to users, see the screenshot attached.

Comment 18 Stefan Nemeth 2016-11-01 09:58:27 UTC
Created attachment 1216036 [details]
patch fixing the bug

Comment 19 Stefan Nemeth 2016-11-01 10:00:09 UTC
patch -p1 /usr/share/foreman/app/controllers/roles_controller.rb < 1378544.patch

Comment 20 Lukas Zapletal 2017-02-24 15:27:01 UTC
REL ENG: TWO patches required, both small:

https://github.com/theforeman/foreman/pull/3925
https://github.com/theforeman/foreman/pull/4244

I already filed MR for the former one.

Comment 21 Bryan Kearney 2017-02-24 19:07:04 UTC
*** Bug 1417994 has been marked as a duplicate of this bug. ***

Comment 27 Peter Ondrejka 2017-03-27 14:18:45 UTC
Verified in Sat 6.2.9-1 using steps from the problem description and comment 13, role cloned from a default role can now be deleted and viewed by entitled users.

Comment 29 errata-xmlrpc 2017-05-01 13:55:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2017:1191