Skip to content

Commit f6ba0a4

Browse files
author
Andre Turner
committed
Revert "schema changes after ap inject"
This reverts commit 788f863.
1 parent f7284cc commit f6ba0a4

23 files changed

+0
-989
lines changed

dbschema/budget.esdl

Lines changed: 0 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,6 @@ module default {
77
universalTemplate: File;
88

99
records := .<budget[is Budget::Record];
10-
11-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForBudget
12-
allow select, update read using (
13-
(
14-
exists (<Role>{'Administrator', 'FieldOperationsDirector', 'LeadFinancialAnalyst', 'Controller', 'FinancialAnalyst', 'Marketing', 'Fundraising', 'ExperienceOperations', 'Leadership', 'ProjectManager', 'RegionalDirector'} intersect global currentRoles)
15-
or (
16-
Role.ConsultantManager in global currentRoles
17-
and (
18-
.isMember
19-
or .sensitivity <= Sensitivity.Medium
20-
)
21-
)
22-
)
23-
);
24-
25-
access policy CanUpdateWriteInsertDeleteGeneratedFromAppPoliciesForBudget
26-
allow update write, insert, delete;
2710
}
2811
}
2912

@@ -46,23 +29,6 @@ module Budget {
4629
readonly := true;
4730
on target delete delete source;
4831
};
49-
50-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForBudgetRecord
51-
allow select, update read using (
52-
(
53-
exists (<default::Role>{'Administrator', 'FieldOperationsDirector', 'LeadFinancialAnalyst', 'Controller', 'FinancialAnalyst', 'Marketing', 'Fundraising', 'ExperienceOperations', 'Leadership', 'ProjectManager', 'RegionalDirector'} intersect global default::currentRoles)
54-
or (
55-
default::Role.ConsultantManager in global default::currentRoles
56-
and (
57-
.isMember
58-
or .sensitivity <= default::Sensitivity.Medium
59-
)
60-
)
61-
)
62-
);
63-
64-
access policy CanUpdateWriteInsertDeleteGeneratedFromAppPoliciesForBudgetRecord
65-
allow update write, insert, delete;
6632
}
6733

6834
scalar type Status extending enum<

dbschema/ceremony.esdl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,6 @@ module Engagement {
77
actualDate: cal::local_date;
88

99
constraint exclusive on (.engagement);
10-
11-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForCeremony
12-
allow select, update read using (
13-
(
14-
exists (<default::Role>{'Administrator', 'FieldOperationsDirector', 'FieldPartner', 'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller', 'Marketing', 'Fundraising', 'ExperienceOperations', 'Leadership', 'ProjectManager', 'RegionalDirector', 'StaffMember'} intersect global default::currentRoles)
15-
or (
16-
exists (<default::Role>{'Consultant', 'ConsultantManager', 'Intern', 'Mentor', 'Translator'} intersect global default::currentRoles)
17-
and .isMember
18-
)
19-
)
20-
);
21-
22-
access policy CanUpdateWriteInsertDeleteGeneratedFromAppPoliciesForCeremony
23-
allow update write, insert, delete;
2410
}
2511
type DedicationCeremony extending Ceremony {}
2612
type CertificationCeremony extending Ceremony {}

dbschema/comments.esdl

Lines changed: 0 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,6 @@
11
module Comments {
22
abstract type Aware extending default::Resource {
33
commentThreads := .<container[is Thread];
4-
5-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForCommentable
6-
allow select, update read using (
7-
exists (<default::Role>{'Administrator', 'Leadership'} intersect global default::currentRoles)
8-
);
9-
10-
access policy CanUpdateWriteGeneratedFromAppPoliciesForCommentable
11-
allow update write;
12-
13-
access policy CanInsertDeleteGeneratedFromAppPoliciesForCommentable
14-
allow insert, delete using (
15-
default::Role.Administrator in global default::currentRoles
16-
);
174
}
185

196
type Thread extending default::Resource, Mixin::Embedded {
@@ -23,60 +10,12 @@ module Comments {
2310
comments := .<thread[is Comment];
2411
firstComment := (select .comments order by .createdAt asc limit 1);
2512
latestComment := (select .comments order by .createdAt desc limit 1);
26-
27-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForCommentThread
28-
allow select, update read using (
29-
(
30-
exists (<default::Role>{'Administrator', 'Leadership'} intersect global default::currentRoles)
31-
or .isCreator
32-
)
33-
);
34-
35-
access policy CanUpdateWriteGeneratedFromAppPoliciesForCommentThread
36-
allow update write;
37-
38-
access policy CanInsertGeneratedFromAppPoliciesForCommentThread
39-
allow insert using (
40-
default::Role.Administrator in global default::currentRoles
41-
);
42-
43-
access policy CanDeleteGeneratedFromAppPoliciesForCommentThread
44-
allow delete using (
45-
(
46-
default::Role.Administrator in global default::currentRoles
47-
or .isCreator
48-
)
49-
);
5013
}
5114

5215
type Comment extending default::Resource {
5316
required thread: Thread {
5417
on target delete delete source;
5518
};
5619
required body: default::RichText;
57-
58-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForComment
59-
allow select, update read using (
60-
(
61-
exists (<default::Role>{'Administrator', 'Leadership'} intersect global default::currentRoles)
62-
or .isCreator
63-
)
64-
);
65-
66-
access policy CanUpdateWriteGeneratedFromAppPoliciesForComment
67-
allow update write;
68-
69-
access policy CanInsertGeneratedFromAppPoliciesForComment
70-
allow insert using (
71-
default::Role.Administrator in global default::currentRoles
72-
);
73-
74-
access policy CanDeleteGeneratedFromAppPoliciesForComment
75-
allow delete using (
76-
(
77-
default::Role.Administrator in global default::currentRoles
78-
or .isCreator
79-
)
80-
);
8120
}
8221
}

dbschema/engagement.esdl

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -47,44 +47,6 @@ module default {
4747
};
4848

4949
description: RichText;
50-
51-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForEngagement
52-
allow select, update read using (
53-
(
54-
exists (<Role>{'Administrator', 'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector', 'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller', 'Marketing', 'Fundraising', 'ExperienceOperations', 'Leadership', 'StaffMember'} intersect global currentRoles)
55-
or (
56-
exists (<Role>{'Consultant', 'ConsultantManager', 'FieldPartner', 'Intern', 'Mentor', 'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector', 'Translator'} intersect global currentRoles)
57-
and .isMember
58-
)
59-
)
60-
);
61-
62-
access policy CanUpdateWriteGeneratedFromAppPoliciesForEngagement
63-
allow update write;
64-
65-
access policy CanInsertGeneratedFromAppPoliciesForEngagement
66-
allow insert using (
67-
(
68-
Role.Administrator in global currentRoles
69-
or (
70-
exists (<Role>{'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector', 'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller'} intersect global currentRoles)
71-
and .isMember
72-
and <str>.project.status = 'InDevelopment'
73-
)
74-
)
75-
);
76-
77-
access policy CanDeleteGeneratedFromAppPoliciesForEngagement
78-
allow delete using (
79-
(
80-
Role.Administrator in global currentRoles
81-
or (
82-
exists (<Role>{'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector', 'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller'} intersect global currentRoles)
83-
and .isMember
84-
and <str>.status = 'InDevelopment'
85-
)
86-
)
87-
);
8850
}
8951

9052
type LanguageEngagement extending Engagement {
@@ -157,11 +119,6 @@ module default {
157119
update __old__.language.projectContext
158120
set { projects -= __old__.project }
159121
);
160-
161-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForLanguageEngagement
162-
allow select, update read using (
163-
Role.ConsultantManager in global currentRoles
164-
);
165122
}
166123

167124
type InternshipEngagement extending Engagement {

dbschema/field-region.esdl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,5 @@ module default {
66

77
required fieldZone: FieldZone;
88
required director: User;
9-
10-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForFieldRegion
11-
allow select, update read using (
12-
exists (<Role>{'Administrator', 'Consultant', 'ConsultantManager', 'FieldPartner', 'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller', 'Marketing', 'Fundraising', 'ExperienceOperations', 'Leadership', 'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector', 'StaffMember'} intersect global currentRoles)
13-
);
14-
15-
access policy CanUpdateWriteGeneratedFromAppPoliciesForFieldRegion
16-
allow update write;
17-
18-
access policy CanInsertDeleteGeneratedFromAppPoliciesForFieldRegion
19-
allow insert, delete using (
20-
Role.Administrator in global currentRoles
21-
);
229
}
2310
}

dbschema/field-zone.esdl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,5 @@ module default {
77
required director: User;
88

99
fieldRegions := .<fieldZone[is FieldRegion];
10-
11-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForFieldZone
12-
allow select, update read using (
13-
exists (<Role>{'Administrator', 'Consultant', 'ConsultantManager', 'FieldPartner', 'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller', 'Marketing', 'Fundraising', 'ExperienceOperations', 'Leadership', 'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector', 'StaffMember'} intersect global currentRoles)
14-
);
15-
16-
access policy CanUpdateWriteGeneratedFromAppPoliciesForFieldZone
17-
allow update write;
18-
19-
access policy CanInsertDeleteGeneratedFromAppPoliciesForFieldZone
20-
allow insert, delete using (
21-
Role.Administrator in global currentRoles
22-
);
2310
}
2411
}

dbschema/file.esdl

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ module default {
44
required totalFiles: int32 {
55
default := 0;
66
};
7-
8-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForDirectory
9-
allow select, update read using (
10-
exists (<Role>{'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller'} intersect global currentRoles)
11-
);
127
}
138

149
# TODO how to front latest version info?
@@ -43,18 +38,5 @@ module File {
4338
depth: int16; # todo enforce
4439
}
4540
# multi link children: Node;
46-
47-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForFileNode
48-
allow select, update read using (
49-
exists (<default::Role>{'Administrator', 'Leadership'} intersect global default::currentRoles)
50-
);
51-
52-
access policy CanUpdateWriteGeneratedFromAppPoliciesForFileNode
53-
allow update write;
54-
55-
access policy CanInsertDeleteGeneratedFromAppPoliciesForFileNode
56-
allow insert, delete using (
57-
default::Role.Administrator in global default::currentRoles
58-
);
5941
}
6042
}

dbschema/funding-account.esdl

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,18 +7,5 @@ module default {
77
required accountNumber: int16 {
88
constraint expression on (__subject__ >= 0 and __subject__ <= 9);
99
}
10-
11-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForFundingAccount
12-
allow select, update read using (
13-
exists (<Role>{'Administrator', 'ConsultantManager', 'FinancialAnalyst', 'LeadFinancialAnalyst', 'Controller', 'Leadership', 'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector', 'StaffMember'} intersect global currentRoles)
14-
);
15-
16-
access policy CanUpdateWriteGeneratedFromAppPoliciesForFundingAccount
17-
allow update write;
18-
19-
access policy CanInsertDeleteGeneratedFromAppPoliciesForFundingAccount
20-
allow insert, delete using (
21-
Role.Administrator in global currentRoles
22-
);
2310
}
2411
}

dbschema/language.esdl

Lines changed: 0 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -87,25 +87,6 @@ module default {
8787
}
8888

8989
index on ((.name, .ownSensitivity, .leastOfThese, .isSignLanguage, .isDialect));
90-
91-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForLanguage
92-
allow select, update read using (
93-
(
94-
exists (<Role>{'Administrator', 'ConsultantManager', 'ExperienceOperations', 'LeadFinancialAnalyst', 'Controller', 'FinancialAnalyst', 'Fundraising', 'Marketing', 'Leadership', 'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector', 'StaffMember'} intersect global currentRoles)
95-
or (
96-
exists (<Role>{'Consultant', 'ConsultantManager', 'FieldPartner', 'Intern', 'Mentor', 'Translator'} intersect global currentRoles)
97-
and .isMember
98-
)
99-
)
100-
);
101-
102-
access policy CanUpdateWriteGeneratedFromAppPoliciesForLanguage
103-
allow update write;
104-
105-
access policy CanInsertDeleteGeneratedFromAppPoliciesForLanguage
106-
allow insert, delete using (
107-
Role.Administrator in global currentRoles
108-
);
10990
}
11091

11192
scalar type population extending int32 {
@@ -128,40 +109,6 @@ module Ethnologue {
128109
};
129110
name: str;
130111
population: default::population;
131-
132-
access policy CanSelectUpdateReadGeneratedFromAppPoliciesForEthnologueLanguage
133-
allow select, update read using (
134-
(
135-
exists (<default::Role>{'Administrator', 'ExperienceOperations', 'Leadership', 'ProjectManager', 'RegionalDirector', 'FieldOperationsDirector'} intersect global default::currentRoles)
136-
or (
137-
default::Role.ConsultantManager in global default::currentRoles
138-
and .sensitivity <= default::Sensitivity.Medium
139-
)
140-
or (
141-
exists (<default::Role>{'Consultant', 'ConsultantManager', 'FieldPartner', 'Translator'} intersect global default::currentRoles)
142-
and .isMember
143-
)
144-
or (
145-
default::Role.Fundraising in global default::currentRoles
146-
and (
147-
.isMember
148-
or .sensitivity <= default::Sensitivity.Medium
149-
)
150-
)
151-
or (
152-
exists (<default::Role>{'Marketing', 'Fundraising', 'ExperienceOperations'} intersect global default::currentRoles)
153-
and .sensitivity <= default::Sensitivity.Low
154-
)
155-
)
156-
);
157-
158-
access policy CanUpdateWriteGeneratedFromAppPoliciesForEthnologueLanguage
159-
allow update write;
160-
161-
access policy CanInsertDeleteGeneratedFromAppPoliciesForEthnologueLanguage
162-
allow insert, delete using (
163-
default::Role.Administrator in global default::currentRoles
164-
);
165112
}
166113

167114
scalar type code extending str {

dbschema/location.esdl

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ module default {
1313
defaultFieldRegion: FieldRegion;
1414
defaultMarketingRegion: Location;
1515
mapImage: File;
16-
17-
access policy CanSelectUpdateReadUpdateWriteGeneratedFromAppPoliciesForLocation
18-
allow select, update read, update write;
19-
20-
access policy CanInsertDeleteGeneratedFromAppPoliciesForLocation
21-
allow insert, delete using (
22-
Role.Administrator in global currentRoles
23-
);
2416
}
2517
}
2618

0 commit comments

Comments
 (0)