Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.14.z] fixes in api role helper functions #13867

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions tests/foreman/api/test_role.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ def test_negative_access_entities_from_org_admin(
target_sat, role_taxos=role_taxonomies, user_taxos=filter_taxonomies
)
domain = self.create_domain(
orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
sc = self.user_config(user, target_sat)
# Getting the domain from user
Expand Down Expand Up @@ -608,7 +608,7 @@ def test_negative_access_entities_from_user(
target_sat, role_taxos=role_taxonomies, user_taxos=filter_taxonomies
)
domain = self.create_domain(
orgs=[filter_taxonomies['org'].id], locs=[filter_taxonomies['loc'].id]
target_sat, orgs=[filter_taxonomies['org'].id], locs=[filter_taxonomies['loc'].id]
)
sc = self.user_config(user, target_sat)
# Getting the domain from user
Expand Down Expand Up @@ -1074,7 +1074,9 @@ def test_negative_assign_org_admin_to_user_group(
name=ug_name, role=[org_admin.id], user=[user_one.id, user_two.id]
).create()
assert user_group.name == ug_name
dom = self.create_domain(orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id])
dom = self.create_domain(
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
for user in [user_one, user_two]:
sc = self.user_config(user, target_sat)
with pytest.raises(HTTPError):
Expand Down Expand Up @@ -1447,7 +1449,7 @@ def test_positive_access_users_inside_org_admin_taxonomies(self, role_taxonomies
user = self.create_org_admin_user(
target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies
)
test_user = self.create_simple_user(filter_taxos=role_taxonomies)
test_user = self.create_simple_user(target_sat, filter_taxos=role_taxonomies)
sc = self.user_config(user, target_sat)
try:
target_sat.api.User(server_config=sc, id=test_user.id).read()
Expand Down Expand Up @@ -1521,7 +1523,7 @@ def test_negative_access_users_outside_org_admin_taxonomies(
user = self.create_org_admin_user(
target_sat, role_taxos=role_taxonomies, user_taxos=role_taxonomies
)
test_user = self.create_simple_user(filter_taxos=filter_taxonomies)
test_user = self.create_simple_user(target_sat, filter_taxos=filter_taxonomies)
sc = self.user_config(user, target_sat)
with pytest.raises(HTTPError):
target_sat.api.User(server_config=sc, id=test_user.id).read()
Expand Down Expand Up @@ -1648,7 +1650,7 @@ def test_negative_access_entities_from_ldap_org_admin(
)
# Creating Domain resource in same taxonomies as Org Admin role to access later
domain = self.create_domain(
orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
sc = ServerConfig(
auth=(create_ldap['ldap_user_name'], create_ldap['ldap_user_passwd']),
Expand Down Expand Up @@ -1692,7 +1694,7 @@ def test_negative_access_entities_from_ldap_user(
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
# Creating Domain resource in different taxonomies to access later
domain = self.create_domain(orgs=[module_org.id], locs=[module_location.id])
domain = self.create_domain(target_sat, orgs=[module_org.id], locs=[module_location.id])
sc = ServerConfig(
auth=(create_ldap['ldap_user_name'], create_ldap['ldap_user_passwd']),
url=create_ldap['sat_url'],
Expand Down Expand Up @@ -1741,6 +1743,7 @@ def test_positive_assign_org_admin_to_ldap_user_group(
)
# Creating Domain resource in same taxonomies as Org Admin role to access later
domain = self.create_domain(
target_sat,
orgs=[create_ldap['authsource'].organization[0].id],
locs=[create_ldap['authsource'].location[0].id],
)
Expand Down Expand Up @@ -1800,7 +1803,7 @@ def test_negative_assign_org_admin_to_ldap_user_group(
)
# Creating Domain resource in same taxonomies as Org Admin role to access later
domain = self.create_domain(
orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
target_sat, orgs=[role_taxonomies['org'].id], locs=[role_taxonomies['loc'].id]
)
users = [
target_sat.api.User(
Expand Down