forked from openimis/openimis-be-grievance_py
-
Notifications
You must be signed in to change notification settings - Fork 1
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 #12 from openimis/feature/CM-869
CM-869: add comment mutation and query
- Loading branch information
Showing
10 changed files
with
313 additions
and
30 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
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
40 changes: 40 additions & 0 deletions
40
grievance_social_protection/migrations/0013_auto_20240422_2108.py
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,40 @@ | ||
# Generated by Django 3.2.24 on 2024-04-22 21:08 | ||
|
||
from django.db import migrations, models | ||
import django.db.models.deletion | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('contenttypes', '0002_remove_content_type_name'), | ||
('grievance_social_protection', '0012_auto_20240418_1137'), | ||
] | ||
|
||
operations = [ | ||
migrations.AlterField( | ||
model_name='comment', | ||
name='commenter_id', | ||
field=models.CharField(max_length=255), | ||
), | ||
migrations.AlterField( | ||
model_name='comment', | ||
name='commenter_type', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='contenttypes.contenttype'), | ||
), | ||
migrations.AlterField( | ||
model_name='comment', | ||
name='ticket', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='grievance_social_protection.ticket'), | ||
), | ||
migrations.AlterField( | ||
model_name='historicalcomment', | ||
name='commenter_id', | ||
field=models.CharField(max_length=255), | ||
), | ||
migrations.AlterField( | ||
model_name='ticket', | ||
name='reporter_type', | ||
field=models.ForeignKey(on_delete=django.db.models.deletion.DO_NOTHING, to='contenttypes.contenttype'), | ||
), | ||
] |
51 changes: 51 additions & 0 deletions
51
...ance_social_protection/migrations/0014_add_grievance_social_protection_rights_to_admin.py
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,51 @@ | ||
# Generated by Django 3.2.24 on 2024-04-22 21:18 | ||
|
||
from django.db import migrations | ||
|
||
from core.utils import insert_role_right_for_system, remove_role_right_for_system | ||
|
||
IMIS_ADMIN_ROLE_IS_SYSTEM = 64 | ||
|
||
gql_query_tickets_perms = 127000 | ||
gql_query_comments_perms = 127004 | ||
gql_mutation_create_tickets_perms = 127001 | ||
gql_mutation_update_tickets_perms = 127002 | ||
gql_mutation_delete_tickets_perms = 127003 | ||
gql_mutation_create_comment_perms = 127005 | ||
|
||
|
||
|
||
def add_rights(apps, schema_editor): | ||
""" | ||
Add subscription CRUD permission to the IMIS Administrator. | ||
""" | ||
insert_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_query_tickets_perms) | ||
insert_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_query_comments_perms) | ||
insert_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_mutation_create_tickets_perms) | ||
insert_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_mutation_update_tickets_perms) | ||
insert_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_mutation_delete_tickets_perms) | ||
insert_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_mutation_create_comment_perms) | ||
|
||
|
||
def remove_rights(apps, schema_editor): | ||
""" | ||
Remove subscription CRUD permissions to the IMIS Administrator. | ||
""" | ||
remove_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_query_tickets_perms) | ||
remove_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_query_comments_perms) | ||
remove_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_mutation_create_tickets_perms) | ||
remove_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_mutation_update_tickets_perms) | ||
remove_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_mutation_delete_tickets_perms) | ||
remove_role_right_for_system(IMIS_ADMIN_ROLE_IS_SYSTEM, gql_mutation_create_comment_perms) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
|
||
dependencies = [ | ||
('grievance_social_protection', '0013_auto_20240422_2108'), | ||
] | ||
|
||
operations = [ | ||
migrations.RunPython(add_rights, remove_rights), | ||
] |
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
Oops, something went wrong.