Skip to content

Commit

Permalink
Add seed data permission type 278 (#303)
Browse files Browse the repository at this point in the history
  • Loading branch information
freaky4wrld authored Aug 9, 2024
1 parent a2053c1 commit 348fbb3
Show file tree
Hide file tree
Showing 3 changed files with 88 additions and 1 deletion.
34 changes: 34 additions & 0 deletions app/core/initial_data/PermissionType_export.json
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"}
]
53 changes: 53 additions & 0 deletions app/data/migrations/0004_permissiontype_seed.py
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)]
2 changes: 1 addition & 1 deletion app/data/migrations/max_migration.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0003_sdg_seed
0004_permissiontype_seed

0 comments on commit 348fbb3

Please sign in to comment.