Bug 1491305

Summary: [API] User cannot access resources through organization path
Product: Red Hat Satellite Reporter: Jitendra Yejare <jyejare>
Component: Users & RolesAssignee: satellite6-bugs <satellite6-bugs>
Status: CLOSED NOTABUG QA Contact: Katello QA List <katello-qa-list>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.3.0CC: bbuckingham, dhlavacd, jyejare, mhulan
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2017-10-17 08:54:29 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: 1373844    

Description Jitendra Yejare 2017-09-13 13:23:57 UTC
Description of problem:
User is unable to view/list resources(in my case domains) through path of organization, even though the user has a permission to access resources(domains) in that organization

Version-Release number of selected component (if applicable):
Satellite 6.3 snap 15

How reproducible:
Always

Steps to Reproduce:
1. Create Domain in Org A and Loc A
2. Create Role with Org A and Loc A 
3. Create Domain Filter in above role without override
4. Create User with Org A and Loc A
5. Assign above role to the user
6. Attempt to GET domains above through Organization path
# curl -u $creds -X GET --header "Content-Type:application/json" "https://FQDN/api/organizations/1/domains" --insecure

Actual results:
API returns,
{"message":"Organization not found by id '1'"}

Expected results:
I know that could be the expected behavior as the user don't have permissions to access organizations but then its really difficult to get the domains listed in particular organizations to which user has permission.

Additional info:

Comment 1 Jitendra Yejare 2017-09-13 13:24:40 UTC
This issue is affecting 6.3 feature Canned Role Org Admin.

Comment 3 Marek Hulan 2017-09-13 13:36:44 UTC
Isn't it possible to list all domains with search like organization_id = 1? If user does not have view_organizations permission, he/she should not have access to it.

Comment 4 Jitendra Yejare 2017-09-13 13:43:30 UTC
Thats True mhulan,
It is not possible to list all domains with a search like organization_id = 1, and the user doesn't have view organizations permission.

The question is how do I list domains in particular org ??

Comment 5 Marek Hulan 2017-09-15 14:40:34 UTC
Jitendra, I was able to list domains of a particular org with the search I provided, e.g. like this

> hammer domain list --search "organization_id = 1"

The only permission that the user has is view_domains. Just make sure that the filter is unlimited. If it does not work for you, please provide a reproducer. My current impression is this is not a bug. Users can list resources without needing to see the organization as long as they don't use organization nested routes.

Comment 8 Jitendra Yejare 2017-10-17 08:54:29 UTC
Hey Marek, 

Extremely sorry that I didn't follow the correct command/way to get the domains as per command 5. Actually, I wasn't aware of --search option.

But now I did, and I can list the domains with given command and API path.


I think we are good to close this bug as there is a way to get the domains in particular org and loc.