Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 757775

Summary: RBAC: user with "Register System" permission cannot register with RHSM
Product: Red Hat Satellite Reporter: Jeff Weiss <jweiss>
Component: InfrastructureAssignee: Lukas Zapletal <lzap>
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: bkearney, cwelton, dajohnso, gstoecke
Target Milestone: UnspecifiedKeywords: TestBlocker, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-04-27 00:32:33 UTC Type: ---
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: 747354, 766906, 768390    

Description Jeff Weiss 2011-11-28 16:59:08 UTC
Description of problem:
If you grant a user the "register system" permission, and he only knows the *name* of the environment he wishes to register to, he cannot register.  The API to look up the ID of the environment is off-limits.

Version-Release number of selected component (if applicable):
katello-0.1.115-1.git.4.fc070ec.el6.x86_64

How reproducible:


Steps to Reproduce:
1. Create a role with perm Global/Organizations/Register System only, and assign a user to only this role
2. Try to register with RHSM (or at a lower level, try to look up the ID of the environment via the API)
3.
  
Actual results:
cannot register

Expected results:
register succeeds

Additional info:

[root@katello-test-rhel6-1 ca]# subscription-manager register --username user-perm-1322498127482 --password password --org ACME_Corporation --env Development
User user-perm-1322498127482 is not allowed to access api/environments/index

Started GET "/katello//api/organizations/ACME_Corporation/environments?name=Development" for 10.16.120.31 at Mon Nov 28 11:35:45 -0500 2011
  Processing by Api::EnvironmentsController#index as JSON
  Parameters: {"name"=>"Development", "organization_id"=>"ACME_Corporation"}
Errors::SecurityViolation: User user-perm-1322498127482 is not allowed to access api/environments/index
/usr/share/katello/lib/authorization_rules.rb:31:in `authorize'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:448:in `_run__856191886__process_action__199225275__callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:221:in `_conditional_callback_around_2122'
/usr/share/katello/lib/util/threadsession.rb:79:in `thread_locals'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:220:in `_conditional_callback_around_2122'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:441:in `_run__856191886__process_action__199225275__callbacks'
/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.10/lib/active_support/callbacks.rb:410:in `send'

Comment 1 Lukas Zapletal 2012-01-20 12:53:57 UTC
[root@ofed ~]# subscription-manager register --username register_system --password register_system --org ACME_Corporation --env env
The system has been registered with id: 3b384ad5-1ff2-4aac-8fbd-663d006f353d 

[root@ofed ~]# rpm -q katello
katello-0.1.187-1.git.1.2d46557.el6.noarch

2d46557 757775 - allowing rhsm to register systems

Comment 3 Jeff Weiss 2012-02-09 21:34:11 UTC
Blocked, cannot test

Comment 4 Jeff Weiss 2012-02-09 21:34:52 UTC
Oops wrong bug, ignore last comment

Comment 5 Corey Welton 2012-02-22 19:08:52 UTC
QA Verified, now able to register a system via RHSM using an account which has only "Register System" permissions.