generated from hackforla/.github-hackforla-base-repo-template
-
-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add seed data permission type 278 (#303)
- Loading branch information
1 parent
a2053c1
commit 348fbb3
Showing
3 changed files
with
88 additions
and
1 deletion.
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,34 @@ | ||
[ | ||
{ | ||
"uuid":1, | ||
"name":"adminGlobal", | ||
"description":"Granted to People Depo Admins. Can CRUD anything."}, | ||
{ | ||
"uuid":2, | ||
"name":"adminVrms", | ||
"description":"Granted to VRMS the application. Can R anything and update permissions for users to the level of Admin Brigade"}, | ||
{ | ||
"uuid":3, | ||
"name":"adminBrigade", | ||
"description":"Granted to Brigage Leads. Can CRUD anything related to a user or project assigned to their brigade "}, | ||
{ | ||
"uuid":4, | ||
"name":"adminProject", | ||
"description":"Granted to Product Managers. Can Read and Update anything related to their assigned project"}, | ||
{ | ||
"uuid":5, | ||
"name":"practiceLeadProject", | ||
"description":"Granted when a user is promoted or assigned to be a Project Lead. Can R and U anything related to people in their practice area (must attend lead events)"}, | ||
{ | ||
"uuid":6, | ||
"name":"practiceLeadJrProject", | ||
"description":"Granted when a user is promoted or assigned to be a Jr Project Lead. Can R and U anything related to people in their practice area (should attend lead events)"}, | ||
{ | ||
"uuid":7, | ||
"name":"memberProject", | ||
"description":"Granted when a user joins a project. Can Read anything related to their project that is visible"}, | ||
{ | ||
"uuid":8, | ||
"name":"memberGeneral", | ||
"description":"Granted when a user finishes onboaring. Can express interest in a project's open role if they are the role"} | ||
] |
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,53 @@ | ||
from django.db import migrations | ||
|
||
from core.models import PermissionType | ||
|
||
|
||
def run(__code__, __reverse_code__): | ||
items = [ | ||
(1, "adminGlobal", "Granted to People Depo Admins. Can CRUD anything."), | ||
( | ||
2, | ||
"adminVrms", | ||
"Granted to VRMS the application. Can R anything and update permissions for users to the level of Admin Brigade", | ||
), | ||
( | ||
3, | ||
"adminBrigade", | ||
"Granted to Brigage Leads. Can CRUD anything related to a user or project assigned to their brigade ", | ||
), | ||
( | ||
4, | ||
"adminProject", | ||
"Granted to Product Managers. Can Read and Update anything related to their assigned project", | ||
), | ||
( | ||
5, | ||
"practiceLeadProject", | ||
"Granted when a user is promoted or assigned to be a Project Lead. Can R and U anything related to people in their practice area (must attend lead events)", | ||
), | ||
( | ||
6, | ||
"practiceLeadJrProject", | ||
"Granted when a user is promoted or assigned to be a Jr Project Lead. Can R and U anything related to people in their practice area (should attend lead events)", | ||
), | ||
( | ||
7, | ||
"memberProject", | ||
"Granted when a user joins a project. Can Read anything related to their project that is visible", | ||
), | ||
( | ||
8, | ||
"memberGeneral", | ||
"Granted when a user finishes onboaring. Can express interest in a project's open role if they are the role", | ||
), | ||
] | ||
for uuid, name, description in items: | ||
PermissionType.objects.create(uuid=uuid, name=name, description=description) | ||
|
||
|
||
class Migration(migrations.Migration): | ||
initial = True | ||
dependencies = [("data", "0003_sdg_seed")] | ||
|
||
operations = [migrations.RunPython(run, migrations.RunPython.noop)] |
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 |
---|---|---|
@@ -1 +1 @@ | ||
0003_sdg_seed | ||
0004_permissiontype_seed |