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 736384

Summary: system registration routes issue when no activation keys present
Product: Red Hat Satellite Reporter: Shannon Hughes <shughes>
Component: APIAssignee: Lukas Zapletal <lzap>
Status: CLOSED CURRENTRELEASE QA Contact: Garik Khachikyan <gkhachik>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 6.0.0CC: gkhachik, lzap, mkoci
Target Milestone: Unspecified   
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-08-22 17:56:07 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    

Description Shannon Hughes 2011-09-07 14:56:26 UTC
Description of problem:
when subscribing a system via subscription manager to katello without activation keys, I am seeing the API systems controller #create action get called as expected but then I also see the activate action being called. Looks like there is a match in the routes that is causing the activate to get invoked:

    match '/consumers' => 'systems#activate', :via => :post, :constraints => RegisterWithActivationKeyContraint.new

this is causing a permissions error that gets sent back to subscription manager, 

'content': "Errors::SecurityViolation: User admin is not allowed to access api/systems/activate\n/git/katello/src/lib/authorization_rules.rb:30:in `authorize'\n/usr/lib/ruby/gems/1.8/gems/activesupport-3.0.5/lib/active_support/callback

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


How reproducible:


Steps to Reproduce:
1.
2.
3.
  
Actual results:


Expected results:


Additional info:

Comment 1 Lukas Zapletal 2011-09-07 15:20:10 UTC
Regarding this issue, I have pushed a simple workaround to allow registration without activation keys.

1634bdc 736384 - workaround for perm. denied for rhsm registration

This should be removed when we refactor permissions for system activations.

Comment 2 Lukas Zapletal 2011-09-13 15:18:56 UTC
So I reverted the temporary fix and refactored way we handle RHSM permissions.

629d2ca 737563 - Subscription Manager fails permissions on accessing subscriptions
eebb966 736141 - Systems Registration perms need to be reworked
e84d7e8 Revert "736384 - workaround for perm. denied (unit test)"
95ea20a Revert "736384 - workaround for perm. denied for rhsm registration"

I am not able to reproduce it now.

Comment 3 Garik Khachikyan 2012-01-13 13:05:10 UTC
# VERIFIED

doing call of `system subscribe` does not invoke the "*#activate" action (looking in the production.log of katello)

All looks fine, RHSM gets exit 0.

Checked against:
katello-0.1.174-2.el6.noarch
katello-cli-0.1.35-1.el6.noarch