Skip to content

Commit

Permalink
Casts a repo object before checking permission
Browse files Browse the repository at this point in the history
This change is similar to #4933, but for the condition function
where domain is not enabled.
[noissue]

ref: #4932
  • Loading branch information
git-hyagi committed Jul 22, 2024
1 parent 2c08679 commit 9f7497e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pulpcore/app/global_access_conditions.py
Original file line number Diff line number Diff line change
Expand Up @@ -479,9 +479,9 @@ def has_repo_or_repo_ver_param_model_or_obj_perms(request, view, action, permiss
)
serializer.is_valid(raise_exception=True)
if repository := serializer.validated_data.get("repository"):
return request.user.has_perm(permission, repository)
return request.user.has_perm(permission, repository.cast())
elif repo_ver := serializer.validated_data.get("repository_version"):
return request.user.has_perm(permission, repo_ver.repository)
return request.user.has_perm(permission, repo_ver.repository.cast())
return True


Expand Down

0 comments on commit 9f7497e

Please sign in to comment.