Skip to content

Commit 2ad35b7

Browse files
committed
add parent and strategicAlliances fields to Partner schema and migration
1 parent 155f3b8 commit 2ad35b7

File tree

2 files changed

+61
-0
lines changed

2 files changed

+61
-0
lines changed

dbschema/migrations/00021-m1ud7t6.edgeql

Lines changed: 12 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dbschema/partner.gel

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,62 @@ module default {
4141
multi languagesOfConsulting: Language;
4242
multi fieldRegions: FieldRegion;
4343
multi countries: Location;
44+
multi strategicAlliances: Partner {
45+
constraint exclusive;
46+
};
47+
48+
parent: Partner {
49+
constraint exclusive;
50+
};
4451

4552
startDate: cal::local_date;
4653

4754
departmentIdBlock: Finance::Department::IdBlock {
4855
on source delete delete target;
4956
on target delete allow;
5057
};
58+
59+
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForPartner
60+
allow select, update read using (
61+
(
62+
exists (<Role>{'ConsultantManager', 'FieldOperationsDirector', 'LeadFinancialAnalyst', 'Controller', 'FinancialAnalyst', 'ProjectManager', 'RegionalDirector'} intersect global currentRoles)
63+
or (
64+
exists (<Role>{'Consultant', 'ConsultantManager', 'FieldPartner'} intersect global currentRoles)
65+
and .isMember
66+
)
67+
or (
68+
exists (<Role>{'ExperienceOperations', 'Fundraising'} intersect global currentRoles)
69+
and (
70+
.isMember
71+
or .sensitivity <= Sensitivity.Medium
72+
)
73+
)
74+
or (
75+
Role.Marketing in global currentRoles
76+
and (
77+
(
78+
.isMember
79+
and .sensitivity <= Sensitivity.Medium
80+
)
81+
or .sensitivity <= Sensitivity.Low
82+
)
83+
)
84+
or (
85+
Role.StaffMember in global currentRoles
86+
and .sensitivity <= Sensitivity.Low
87+
)
88+
)
89+
);
90+
91+
access policy CanInsertGeneratedFromAppPoliciesForPartner
92+
allow insert using (
93+
exists (<Role>{'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller'} intersect global currentRoles)
94+
);
95+
96+
access policy CanDeleteGeneratedFromAppPoliciesForPartner
97+
allow delete using (
98+
Role.Controller in global currentRoles
99+
);
51100
}
52101
}
53102

0 commit comments

Comments
 (0)