-
Notifications
You must be signed in to change notification settings - Fork 330
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1587 from coronasafe/master
Production Release; Sep Week 2
- Loading branch information
Showing
24 changed files
with
568 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# To get started with Dependabot version updates, you'll need to specify which | ||
# package ecosystems to update and where the package manifests are located. | ||
# Please see the documentation for all configuration options: | ||
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates | ||
|
||
version: 2 | ||
updates: | ||
- package-ecosystem: "pip" # See documentation for possible values | ||
directory: "/" # Location of package manifests | ||
schedule: | ||
interval: "Weekly" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 4.2.2 on 2023-09-05 06:42 | ||
|
||
from django.db import migrations, models | ||
|
||
|
||
class Migration(migrations.Migration): | ||
dependencies = [ | ||
("abdm", "0009_healthfacility"), | ||
] | ||
|
||
operations = [ | ||
migrations.AddField( | ||
model_name="healthfacility", | ||
name="registered", | ||
field=models.BooleanField(default=False), | ||
), | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
from care.facility.models.mixins.permissions.base import BasePermissionMixin | ||
from care.users.models import User | ||
|
||
|
||
class HealthFacilityPermissions(BasePermissionMixin): | ||
""" | ||
Permissions for HealthFacilityViewSet | ||
""" | ||
|
||
def has_object_read_permission(self, request): | ||
return self.facility.has_object_read_permission(request) | ||
|
||
def has_object_write_permission(self, request): | ||
allowed_user_types = [ | ||
User.TYPE_VALUE_MAP["WardAdmin"], | ||
User.TYPE_VALUE_MAP["LocalBodyAdmin"], | ||
User.TYPE_VALUE_MAP["DistrictAdmin"], | ||
User.TYPE_VALUE_MAP["StateAdmin"], | ||
] | ||
return request.user.is_superuser or ( | ||
request.user.user_type in allowed_user_types | ||
and self.facility.has_object_write_permission(request) | ||
) | ||
|
||
def has_object_update_permission(self, request): | ||
return self.has_object_write_permission(request) | ||
|
||
def has_object_destroy_permission(self, request): | ||
return self.has_object_write_permission(request) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.