hostgroup nonadmin viewer read - #20875
Merged
Merged
Conversation
Verifies: SAT-38451 New test for bug "Non-admin users on Satellite with viewer role, unable to see the hostgroup." Ensure that non-admin user with viewer role can see hostgroup created by admin user. Also added new `UserFactory` class to help with more reusable user fixtures.
Contributor
Reviewer's GuideAdd a UI test ensuring a non-admin user with the Viewer role can see an admin-created host group, and introduce reusable user/hostgroup fixtures including a UserFactory helper and a host group fixture bound to org/location. Sequence diagram for non-admin Viewer user reading admin-created hostgroupsequenceDiagram
actor Admin
actor Viewer
participant Test as TestCase
participant SatAPI as Satellite_API
participant SatUI as Satellite_UI
Test->>SatAPI: create_hostgroup_with_org_loc()
SatAPI-->>Test: hostgroup
Test->>SatAPI: UserFactory.create_user(admin=False, role=Viewer)
SatAPI-->>Test: viewer_user
Viewer->>SatUI: login(username, password)
SatUI-->>Viewer: dashboard
Viewer->>SatUI: navigate_to_hostgroups()
SatUI->>SatAPI: list_hostgroups_for_user(viewer_user)
SatAPI-->>SatUI: hostgroups_in_org_and_location
SatUI-->>Viewer: display_hostgroup_list(includes_admin_created)
Test-->>Test: assert hostgroup is visible to viewer_user
ER diagram for user, role, hostgroup, org, and location relationshipserDiagram
USER ||--o{ ROLE : has
USER }o--|| ORGANIZATION : belongs_to
USER }o--|| LOCATION : scoped_to
HOSTGROUP }o--|| ORGANIZATION : scoped_to
HOSTGROUP }o--|| LOCATION : scoped_to
ROLE {
string name
}
USER {
string username
string password
boolean admin
}
ORGANIZATION {
string name
}
LOCATION {
string name
}
HOSTGROUP {
string name
}
Class diagram for the new UserFactory helperclassDiagram
class UserFactory {
+create_user(target_sat, params)
}
class Satellite {
}
class User {
+password
}
UserFactory ..> Satellite : uses
UserFactory ..> User : creates
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
Author
|
trigger: test-robottelo |
Collaborator
|
PRT Result |
pnovotny
marked this pull request as ready for review
February 25, 2026 17:55
LadislavVasina1
approved these changes
Feb 26, 2026
pondrejk
approved these changes
Feb 26, 2026
github-actions Bot
pushed a commit
that referenced
this pull request
Feb 26, 2026
hostgroups: new test for non-admin viewer role Verifies: SAT-38451 New test for bug "Non-admin users on Satellite with viewer role, unable to see the hostgroup." Ensure that non-admin user with viewer role can see hostgroup created by admin user. Also added new `UserFactory` class to help with more reusable user fixtures. (cherry picked from commit 0da20ab)
github-actions Bot
pushed a commit
that referenced
this pull request
Feb 26, 2026
hostgroups: new test for non-admin viewer role Verifies: SAT-38451 New test for bug "Non-admin users on Satellite with viewer role, unable to see the hostgroup." Ensure that non-admin user with viewer role can see hostgroup created by admin user. Also added new `UserFactory` class to help with more reusable user fixtures. (cherry picked from commit 0da20ab)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem Statement
New test coverage for bug SAT-38451: Non-admin users on Satellite with viewer role, unable to see the hostgroup.
Solution
Ensure that non-admin user with viewer role can see hostgroup created by admin user.
Also added new
UserFactoryclass to help with more reusable user fixtures.PRT
Summary by Sourcery
Add test coverage to ensure non-admin users with Viewer role can see host groups created by admin users and introduce reusable user and host group fixtures to support this scenario.
New Features:
Tests: