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 1804817

Summary: hammer filter create fails with invalid error message
Product: Red Hat Satellite Reporter: Anand Agrawal <aagrawal>
Component: Users & RolesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED DUPLICATE QA Contact: Radovan Drazny <rdrazny>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.7.0CC: mhulan, mshira
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-06-22 08:49:28 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:

Description Anand Agrawal 2020-02-19 16:57:09 UTC
Description of problem:

Hammer "For CLI Users" steps in the below document https://access.redhat.com/documentation/en-us/red_hat_satellite/6.7-beta/html-single/managing_hosts/index#setting-permissions-for-the-bootstrap-script mentions creating a role Bootstrap and then creating the filter for this role as below:

ROLE='Bootstrap'
hammer role create --name "$ROLE"
hammer filter create --role "$ROLE" --permissions view_organizations
hammer filter create --role "$ROLE" --permissions view_locations

This fails with below error:

# hammer filter create --role "$ROLE" --permissions view_organizations

Could not create the permission filter:
  Location ids You can't assign locations to this resource

# hammer filter create --role "$ROLE" --permissions view_locations

Could not create the permission filter:
  Organization ids You can't assign organizations to this resource

========================

Issue 1: This should not have failed or needs document correction but this is failing (Reason: Default Organization and Location are set to the role when the role is created)

=======================
Issue 2: While creating filter with "view_locations", error message says can't assign organization. This should be "You can't assign locations to this resource"

=======================
Issue 3: While creating filter with "view_organizations", error message says can't assign location. This should be "You can't assign organizations to this resource"
=========================

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


How reproducible:
Always

Steps to Reproduce:
1. Follow CLI User steps from document https://access.redhat.com/documentation/en-us/red_hat_satellite/6.7-beta/html-single/managing_hosts/index#setting-permissions-for-the-bootstrap-script

2. ROLE='Bootstrap'
hammer role create --name "$ROLE"
hammer filter create --role "$ROLE" --permissions view_organizations
hammer filter create --role "$ROLE" --permissions view_locations

Actual results:

# hammer filter create --role "$ROLE" --permissions view_organizations
Could not create the permission filter:
  Location ids You can't assign locations to this resource

# hammer filter create --role "$ROLE" --permissions view_locations
Could not create the permission filter:
  Organization ids You can't assign organizations to this resource


Expected results:
Error message should be correct for organization and location.

Additional info:

https://bugzilla.redhat.com/show_bug.cgi?id=1792339

Comment 3 Shira Maximov 2020-06-22 07:46:25 UTC
Anand, I think that this BZ might be a duplication of this BZ: https://bugzilla.redhat.com/show_bug.cgi?id=1792339, and it was solved, can you please confirm that the solution is working for you ?

Comment 4 Anand Agrawal 2020-06-22 08:49:28 UTC
(In reply to Shira Maximov from comment #3)
> Anand, I think that this BZ might be a duplication of this BZ:
> https://bugzilla.redhat.com/show_bug.cgi?id=1792339, and it was solved, can
> you please confirm that the solution is working for you ?

Hello Shira,

You are right. This bug is the duplicate of the BZ https://bugzilla.redhat.com/show_bug.cgi?id=1792339. 

I have checked on Satellite  6.7 and this seems to resolve the issue.

Hence, closing this bug.

Regards,
Anand

*** This bug has been marked as a duplicate of bug 1792339 ***