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

Allow skills access for any user #1196

Merged
merged 3 commits into from
Feb 22, 2023

Conversation

Ashesh3
Copy link
Member

@Ashesh3 Ashesh3 commented Feb 18, 2023

This PR allows any user to access the skills of any other user.

Fixes coronasafe/care_fe#4830

Associated Issue

@coronasafe/code-reviewers

@Ashesh3 Ashesh3 requested a review from a team as a code owner February 18, 2023 14:22
@codecov-commenter
Copy link

codecov-commenter commented Feb 18, 2023

Codecov Report

Base: 55.86% // Head: 56.02% // Increases project coverage by +0.15% 🎉

Coverage data is based on head (5cc1e90) compared to base (c5cbe65).
Patch coverage: 37.50% of modified lines in pull request are covered.

📣 This organization is not using Codecov’s GitHub App Integration. We recommend you install it so Codecov can continue to function properly for your repositories. Learn more

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1196      +/-   ##
==========================================
+ Coverage   55.86%   56.02%   +0.15%     
==========================================
  Files         177      174       -3     
  Lines        8832     8802      -30     
  Branches     1521     1519       -2     
==========================================
- Hits         4934     4931       -3     
+ Misses       3844     3817      -27     
  Partials       54       54              
Impacted Files Coverage Δ
care/users/api/viewsets/userskill.py 50.00% <37.50%> (-9.10%) ⬇️
care/users/api/viewsets/users.py 52.00% <0.00%> (-2.27%) ⬇️
care/utils/notification_handler.py 16.36% <0.00%> (-0.45%) ⬇️
...anagement/commands/generate_state_admin_summary.py
...gement/commands/generate_district_admin_summary.py
care/utils/whatsapp/send_mesage.py

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

@sonarcloud
Copy link

sonarcloud bot commented Feb 21, 2023

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 1 Code Smell

No Coverage information No Coverage information
0.0% 0.0% Duplication

):
return False

if not requesting_user.user_type >= user.user_type:
Copy link
Member

Choose a reason for hiding this comment

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

There is no check that confirms if the user is part of the same dist as the dist admin or the same state as the state admin here, but i will approve this PR for now. Do make these changes later or start a new issue for it.

This should ideally be a helper function that checks if a user has control over another user. this might be useful in many other occasions.

@vigneshhari vigneshhari merged commit ba6f19b into coronasafe:master Feb 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bug: linked skill are not viewable
3 participants