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

ISE when trying to publish using repo version with rbac #4932

Closed
jlsherrill opened this issue Jan 16, 2024 · 0 comments · Fixed by #4933
Closed

ISE when trying to publish using repo version with rbac #4932

jlsherrill opened this issue Jan 16, 2024 · 0 comments · Fixed by #4933

Comments

@jlsherrill
Copy link
Contributor

Version
pulp-ubi d896d2d

Describe the bug

While using RBAC, when trying to do a publish with a repository version, we get an error:

pulp [46b2ec908104420dab665feede8b2198]: django.request:ERROR: Internal Server Error: /pulp/46a30c97/api/v3/publications/rpm/rpm/
Traceback (most recent call last):
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/exception.py", line 55, in inner
response = get_response(request)
File "/usr/local/lib/python3.8/site-packages/django/core/handlers/base.py", line 197, in _get_response
response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/local/lib/python3.8/site-packages/django/views/decorators/csrf.py", line 56, in wrapper_view
return view_func(*args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/rest_framework/viewsets.py", line 125, in view
return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 509, in dispatch
response = self.handle_exception(exc)
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 469, in handle_exception
self.raise_uncaught_exception(exc)
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
raise exc
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 497, in dispatch
self.initial(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/pulpcore/app/viewsets/base.py", line 300, in initial
super().initial(request, *args, **kwargs)
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 415, in initial
self.check_permissions(request)
File "/usr/local/lib/python3.8/site-packages/rest_framework/views.py", line 332, in check_permissions
if not permission.has_permission(request, self):
File "/usr/local/lib/python3.8/site-packages/rest_access_policy/access_policy.py", line 69, in has_permission
allowed = self._evaluate_statements(statements, request, view, action)
File "/usr/local/lib/python3.8/site-packages/rest_access_policy/access_policy.py", line 113, in _evaluate_statements
matched = self._get_statements_matching_conditions(
File "/usr/local/lib/python3.8/site-packages/rest_access_policy/access_policy.py", line 262, in _get_statements_matching_conditions
passed = self._check_condition(condition, request, view, action)
File "/usr/local/lib/python3.8/site-packages/rest_access_policy/access_policy.py", line 286, in _check_condition
result = method(request, view, action, arg)
File "/usr/local/lib/python3.8/site-packages/pulpcore/app/global_access_conditions.py", line 428, in has_repo_or_repo_ver_param_model_or_domain_or_obj_perms
return request.user.has_perm(permission, repo_ver.repository)
File "/usr/local/lib/python3.8/site-packages/django/contrib/auth/models.py", line 311, in has_perm
return _user_has_perm(self, perm, obj)
File "/usr/local/lib/python3.8/site-packages/django/contrib/auth/models.py", line 220, in _user_has_perm
if backend.has_perm(user, perm, obj):
File "/usr/local/lib/python3.8/site-packages/pulpcore/backends.py", line 65, in has_perm
raise RuntimeError(
RuntimeError: Permission rpm.view_rpmrepository is not suitable for objects of class <class 'pulpcore.app.models.repository.Repository'>.

To Reproduce
@dkliban can provide more details

Expected behavior
publish happens without an error

Additional context
Add any other context about the problem here. Please provide links to any previous discussions via Discourse or Bugzilla.

dkliban added a commit to dkliban/pulpcore that referenced this issue Jan 16, 2024
dkliban added a commit to dkliban/pulp-service that referenced this issue Jan 16, 2024
dkliban added a commit to dkliban/pulpcore that referenced this issue Jan 16, 2024
dkliban added a commit to dkliban/pulpcore that referenced this issue Jan 16, 2024
dkliban added a commit to dkliban/pulpcore that referenced this issue Jan 16, 2024
@dkliban dkliban reopened this Jan 16, 2024
patchback bot pushed a commit that referenced this issue Jan 17, 2024
dkliban added a commit that referenced this issue Jan 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants