Skip to content

Commit

Permalink
Merge pull request RedHatInsights#1102 from astrozzc/fix
Browse files Browse the repository at this point in the history
Fix some issues
  • Loading branch information
astrozzc authored May 20, 2024
2 parents 588908e + 61e71ab commit 5004a2a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
13 changes: 5 additions & 8 deletions rbac/internal/specs/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -984,7 +984,7 @@
}
},
"/api/utils/role_migration/": {
"delete": {
"post": {
"tags": [
"Role migration"
],
Expand Down Expand Up @@ -1012,14 +1012,11 @@
}
],
"responses": {
"204": {
"description": "Permission deleted"
},
"400": {
"description": "Bad Input"
"202": {
"description": "Role migration from V1 to V2 are running in a background worker."
},
"404": {
"description": "Not Found",
"405": {
"description": "Invalid method, only 'POST' is allowed.",
"content": {
"application/json": {
"schema": {
Expand Down
2 changes: 1 addition & 1 deletion rbac/migration_tool/ingest.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ def extract_info_into_v1_role(role: Role):
"""Extract the information from the role and returns a V1role object."""
perm_res_defs: dict[Tuple[str, str], list[V1resourcedef]] = {}
roles: dict[str, list[str]] = {}
role_id = f"{role.id}"
for access in role.access.all():
for resource_def in access.resourceDefinitions.all():
attri_filter = resource_def.attributeFilter
res_def = V1resourcedef(attri_filter["key"], attri_filter["operation"], attri_filter["value"])
role_id = f"{role.id}"
if res_def.resource_id != "":
add_element(perm_res_defs, (role_id, access.permission.permission), res_def)
extend_unique(roles, role_id, access.permission.permission)
Expand Down

0 comments on commit 5004a2a

Please sign in to comment.