-
Notifications
You must be signed in to change notification settings - Fork 429
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
fix: Non-admin users cannot link a feature to a GH Issue/PR #4336
fix: Non-admin users cannot link a feature to a GH Issue/PR #4336
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 3 Skipped Deployments
|
Docker builds report
|
Uffizzi Preview |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #4336 +/- ##
=======================================
Coverage 96.77% 96.77%
=======================================
Files 1159 1159
Lines 38069 38079 +10
=======================================
+ Hits 36842 36852 +10
Misses 1227 1227 ☔ View full report in Codecov by Sentry. |
40ec824
to
2a9bcc4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some minor questions but nothing major
@@ -189,18 +189,20 @@ def has_object_permission(self, request, view, obj): | |||
|
|||
|
|||
class GithubIsAdminOrganisation(NestedIsOrganisationAdminPermission): | |||
def has_permission(self, request, view): | |||
def has_permission(self, request, view) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
def has_permission(self, request, view) -> bool: | |
def has_permission(self, request: Request, view: GenericViewSet) -> bool: |
if isinstance(request.user, FFAdminUser): | ||
return request.user.is_organisation_admin( | ||
Organisation.objects.get(pk=organisation_pk) | ||
) | ||
else: | ||
return request.user.is_master_api_key_user | ||
|
||
def has_object_permission(self, request, view, obj): | ||
def has_object_permission(self, request, view, obj) -> bool: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: typing
# When | ||
response = staff_client.get(url) | ||
# Then | ||
assert response.status_code == status.HTTP_200_OK |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we add additional assertions here like testing that the GitHub configuration looks like something we expect?
3fa14a9
to
2dc2eaf
Compare
Thanks for submitting a PR! Please check the boxes below:
pre-commit
to check lintingdocs/
if required so people know about the feature!Changes
Granting a non-admin user permission to view the repositories integrated with Flagsmith allows them to link issues/PRs with features in the UI
How did you test this code?
Unit test added