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

update permissions for write access #946

Merged
merged 2 commits into from
Jul 29, 2022

Conversation

iamsdas
Copy link
Contributor

@iamsdas iamsdas commented Jul 25, 2022

fixes: #938

@codecov-commenter
Copy link

codecov-commenter commented Jul 25, 2022

Codecov Report

Merging #946 (3265182) into master (964a7d6) will decrease coverage by 1.52%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##           master     #946      +/-   ##
==========================================
- Coverage   54.24%   52.72%   -1.53%     
==========================================
  Files         181      181              
  Lines        8850     8924      +74     
==========================================
- Hits         4801     4705      -96     
- Misses       4049     4219     +170     
Impacted Files Coverage Δ
...are/facility/models/mixins/permissions/facility.py 34.78% <0.00%> (-15.22%) ⬇️
care/facility/models/mixins/permissions/patient.py 27.77% <0.00%> (ø)
...e/utils/serializer/phonenumber_ispossible_field.py 50.00% <0.00%> (-43.75%) ⬇️
config/serializers.py 36.84% <0.00%> (-31.58%) ⬇️
care/audit_log/middleware.py 47.36% <0.00%> (-22.81%) ⬇️
care/facility/api/viewsets/facility.py 51.11% <0.00%> (-19.16%) ⬇️
care/facility/api/serializers/facility.py 81.25% <0.00%> (-16.43%) ⬇️
care/users/models.py 73.94% <0.00%> (-16.20%) ⬇️
care/users/api/viewsets/users.py 43.50% <0.00%> (-12.34%) ⬇️
... and 12 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 964a7d6...3265182. Read the comment docs.

@iamsdas iamsdas marked this pull request as ready for review July 25, 2022 08:37
@iamsdas iamsdas requested a review from a team as a code owner July 25, 2022 08:37
@iamsdas iamsdas requested a review from gigincg July 25, 2022 08:37
return (
self.has_object_read_permission(request)
and request.user.user_type == User.TYPE_VALUE_MAP["Doctor"]
or request.user.user_type >= User.TYPE_VALUE_MAP["DistrictAdmin"]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This overrides the check for dist admins right? False and False or True is True

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, I messed up the logic 😅

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated it

care/facility/models/mixins/permissions/patient.py Outdated Show resolved Hide resolved
@vigneshhari
Copy link
Member

Why the force pushes ?

@iamsdas
Copy link
Contributor Author

iamsdas commented Jul 26, 2022

Why the force pushes ?

I thought that it would have been better to have a single commit for smaller changes.

@sonarcloud
Copy link

sonarcloud bot commented Jul 27, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

@vigneshhari
Copy link
Member

All commits will end up being squashed to one, so no worries!
Don't let the dark side tempt you! Use the force wisely!!

@vigneshhari vigneshhari merged commit df1b787 into coronasafe:master Jul 29, 2022
@iamsdas iamsdas deleted the permission branch July 29, 2022 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants