Bug 1102290

Summary: Perms for content host registration + env lockin
Product: Red Hat Satellite Reporter: Eric Helms <ehelms>
Component: Content ManagementAssignee: Partha Aji <paji>
Status: CLOSED CURRENTRELEASE QA Contact: Sachin Ghai <sghai>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 6.0.3CC: cwelton, ehelms, jmontleo, mmccune, paji, sghai
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
URL: http://projects.theforeman.org/issues/5911
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-07-02 14:08:45 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:
Attachments:
Description Flags
assigned perms to user none

Description Eric Helms 2014-05-28 16:54:39 UTC
Add permissions to environment and content hosts and implement the lockin based of the following criteria

Rules of the Game
To register a system one needs
1) create_content_hosts (under content hosts resource) 
2) register_content_hosts_to_content_views
3) view_content_views
4) register_content_hosts_to_environments

Comment 1 Eric Helms 2014-05-28 16:54:41 UTC
Created from redmine issue http://projects.theforeman.org/issues/5911

Comment 4 Partha Aji 2014-06-05 18:23:26 UTC
slight modification on the rules

To register a system one needs
1) create_content_hosts (under content hosts resource) 
2) view_content_views for the content view being registered ot
3) view_environments for the environment being registered to

Comment 5 Partha Aji 2014-06-05 18:23:55 UTC
commit # 85af6d026e3e9fad13d8fdf7bb589a8e986e32ff

Comment 8 Sachin Ghai 2014-06-17 10:43:30 UTC
I'm assuming, here we were discussing about what permissions a normal user should have for registering content-host with sat6 server ?

Based on above assumption, I created a user 'test' and a role. Added following permissions to newly created role..

- create_content_hosts
- view_content_views
- view_environments

Assign the role to new user 'test'. and tried registration as below:

[root@vodka ~]# subscription-manager register --username test --password redhat --env dev/cv-rhel65-ks
The system has been registered with ID: 27123905-b58d-47e3-bb32-8418b7fe2fb0 
[root@vodka ~]# 

System was registered successfully.

Comment 9 Sachin Ghai 2014-06-17 10:45:11 UTC
@Eric: I tried to verify this bz with sat6 beta snap9 compose2.  

Please see comment8 for verification steps. Please correct me if my assumptions are incorrect as in comment8.

Comment 10 Partha Aji 2014-06-18 16:03:17 UTC
Sachin,
That looks good to me. Just make sure 
1) User without these perms cant register.
2) Also you can try creating roles that has
- create_content_hosts
- view_content_views specifically on view 1
- view_environments specifically on env 1

specifically try registering to that environment/content view combination. Any other combination must fail.

Comment 11 Sachin Ghai 2014-06-20 16:12:47 UTC
Thanks Partha. I tried following combination too with sat6 beta snap10.

- create_content_hosts
- view_content_views specifically on view 1
- view_environments specifically on env 1


I've given access of env "Dev" and cv "cv-rhel65-ks" to user test. And I was able to register host with user test with same cv and env.

[root@shost ~]# subscription-manager register --username test --password redhat --env Dev/cv-rhel65-ks --org ACME_Corporation
The system has been registered with ID: f290087d-b16b-4a95-9fe3-30ab0c645ab1 


Also, when I used some other combination then got following:

[root@shost ~]# subscription-manager register --username test --password redhat --env dev/cv-rhel65-ks --org ACME_Corporation
No such environment: dev/cv-rhel65-ks

Please see the permissions assigned to user via UI.

Comment 12 Sachin Ghai 2014-06-20 16:13:44 UTC
Created attachment 910821 [details]
assigned perms to user

Comment 13 Bryan Kearney 2014-07-02 14:08:45 UTC
This was delivered with 6.0.3, which is the Satellite 6 Beta.

Comment 14 Bryan Kearney 2014-07-02 14:10:10 UTC
This was delivered in 6.0.3, the Beta version of Satellite 6.0