[6.18.z] hostgroup nonadmin viewer read - #20887
Merged
Satellite-QE merged 1 commit intoFeb 26, 2026
Merged
Conversation
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)
Collaborator
Author
|
trigger: test-robottelo |
Collaborator
Author
|
PRT Result |
Contributor
Reviewer's GuideAdds a UI test to verify a non-admin user with the Viewer role can see host groups created by an admin and introduces reusable fixtures, including a UserFactory helper, a shared Viewer role fixture, and a hostgroup fixture bound to organization and location. Class diagram for new UserFactory helperclassDiagram
class UserFactory {
<<static>> create_user(target_sat, params) User
}
class Satellite {
}
class APIUser {
password
create()
}
UserFactory ..> Satellite : uses target_sat
Satellite ..> APIUser : api.User(**params)
UserFactory ..> APIUser : returns
Flow diagram for new Viewer user and hostgroup fixturesflowchart TD
subgraph User_related_fixtures
A[viewer_role fixture
searches Role name=Viewer
on session_target_sat] --> B[default_viewer_role fixture
creates non_admin user
via UserFactory]
A --> C[module_user_viewer fixture
creates non_admin Viewer user
via UserFactory]
D[UserFactory.create_user
sets default password
creates API User
returns user with password]
B --> D
C --> D
end
subgraph Hostgroup_related_fixtures
E[module_hostgroup_with_org_loc fixture
creates HostGroup
bound to module_org and module_location]
end
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
Contributor
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The new
viewer_rolefixture is bound tosession_target_satbut is later passed intomodule_target_sat.api.User(...)calls; if those API clients are not interchangeable this could cause subtle issues, so consider resolving the role via the samemodule_target_satused to create the user. - For consistency and easier future maintenance, you might want to route other user-creation fixtures (e.g.,
module_user) throughUserFactory.create_useras well so user initialization logic is centralized in one place.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The new `viewer_role` fixture is bound to `session_target_sat` but is later passed into `module_target_sat.api.User(...)` calls; if those API clients are not interchangeable this could cause subtle issues, so consider resolving the role via the same `module_target_sat` used to create the user.
- For consistency and easier future maintenance, you might want to route other user-creation fixtures (e.g., `module_user`) through `UserFactory.create_user` as well so user initialization logic is centralized in one place.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Satellite-QE
deleted the
cherry-pick-6.18.z-0da20aba3a316b090dff2355ba0b152b2a213a94
branch
February 26, 2026 09:54
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.
Cherrypick of PR: #20875
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 and shared fixtures to validate that non-admin users with the Viewer role can read host groups created by admin users.
New Features:
Tests: