Skip to content

Commit 4bad327

Browse files
committed
Adapt ACL to combined isPublic column
Refs #8004
1 parent a54618b commit 4bad327

26 files changed

+50
-271
lines changed

api/src/Entity/Activity.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
new Get(
3434
normalizationContext: self::ITEM_NORMALIZATION_CONTEXT,
3535
security: 'is_granted("CAMP_COLLABORATOR", object) or
36-
is_granted("CAMP_IS_SHARED", object) or
37-
is_granted("CAMP_IS_PROTOTYPE", object)'
36+
is_granted("CAMP_IS_PUBLIC", object)'
3837
),
3938
new Patch(
4039
normalizationContext: self::ITEM_NORMALIZATION_CONTEXT,
@@ -56,8 +55,7 @@
5655
toProperty: 'camp',
5756
fromClass: Camp::class,
5857
security: 'is_granted("CAMP_COLLABORATOR", camp) or
59-
is_granted("CAMP_IS_SHARED", camp) or
60-
is_granted("CAMP_IS_PROTOTYPE", camp)'
58+
is_granted("CAMP_IS_PUBLIC", camp)'
6159
),
6260
],
6361
normalizationContext: self::COLLECTION_NORMALIZATION_CONTEXT,

api/src/Entity/ActivityProgressLabel.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
new Get(
3131
normalizationContext: self::ITEM_NORMALIZATION_CONTEXT,
3232
security: 'is_granted("CAMP_COLLABORATOR", object) or
33-
is_granted("CAMP_IS_SHARED", object) or
34-
is_granted("CAMP_IS_PROTOTYPE", object)'
33+
is_granted("CAMP_IS_PUBLIC", object)'
3534
),
3635
new Patch(
3736
normalizationContext: self::ITEM_NORMALIZATION_CONTEXT,
@@ -53,8 +52,7 @@
5352
toProperty: 'camp',
5453
fromClass: Camp::class,
5554
security: 'is_granted("CAMP_COLLABORATOR", camp) or
56-
is_granted("CAMP_IS_SHARED", camp) or
57-
is_granted("CAMP_IS_PROTOTYPE", camp)'
55+
is_granted("CAMP_IS_PUBLIC", camp)'
5856
),
5957
],
6058
security: 'is_fully_authenticated()',

api/src/Entity/ActivityResponsible.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
#[ApiResource(
2424
operations: [
2525
new Get(
26-
security: 'is_granted("CAMP_COLLABORATOR", object) or is_granted("CAMP_IS_SHARED", object) or is_granted("CAMP_IS_PROTOTYPE", object)'
26+
security: 'is_granted("CAMP_COLLABORATOR", object) or is_granted("CAMP_IS_PUBLIC", object)'
2727
),
2828
new Delete(
2929
security: 'is_granted("CAMP_MEMBER", object) or is_granted("CAMP_MANAGER", object)'

api/src/Entity/Camp.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,7 @@
3535
operations: [
3636
new Get(
3737
security: 'is_granted("CAMP_COLLABORATOR", object) or
38-
is_granted("CAMP_IS_SHARED", object) or
39-
is_granted("CAMP_IS_PROTOTYPE", object)',
38+
is_granted("CAMP_IS_PUBLIC", object)',
4039
normalizationContext: self::ITEM_NORMALIZATION_CONTEXT,
4140
),
4241
new Patch(

api/src/Entity/CampCollaboration.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
operations: [
3636
new Get(
3737
normalizationContext: self::ITEM_NORMALIZATION_CONTEXT,
38-
security: 'is_granted("CAMP_COLLABORATOR", object) or is_granted("CAMP_IS_SHARED", object) or is_granted("CAMP_IS_PROTOTYPE", object)'
38+
security: 'is_granted("CAMP_COLLABORATOR", object) or is_granted("CAMP_IS_PUBLIC", object)'
3939
),
4040
new Patch(
4141
processor: CampCollaborationUpdateProcessor::class,
@@ -68,8 +68,7 @@
6868
toProperty: 'camp',
6969
fromClass: Camp::class,
7070
security: 'is_granted("CAMP_COLLABORATOR", camp) or
71-
is_granted("CAMP_IS_SHARED", camp) or
72-
is_granted("CAMP_IS_PROTOTYPE", camp)'
71+
is_granted("CAMP_IS_PUBLIC", camp)'
7372
),
7473
],
7574
security: 'is_fully_authenticated()',

api/src/Entity/Category.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,7 @@
3636
new Get(
3737
normalizationContext: self::ITEM_NORMALIZATION_CONTEXT,
3838
security: 'is_granted("CAMP_COLLABORATOR", object) or
39-
is_granted("CAMP_IS_SHARED", object) or
40-
is_granted("CAMP_IS_PROTOTYPE", object)'
39+
is_granted("CAMP_IS_PUBLIC", object)'
4140
),
4241
new Patch(
4342
denormalizationContext: ['groups' => ['write', 'update']],
@@ -66,8 +65,7 @@
6665
fromClass: Camp::class,
6766
toProperty: 'camp',
6867
security: 'is_granted("CAMP_COLLABORATOR", camp) or
69-
is_granted("CAMP_IS_SHARED", camp) or
70-
is_granted("CAMP_IS_PROTOTYPE", camp)'
68+
is_granted("CAMP_IS_PUBLIC", camp)'
7169
),
7270
],
7371
extraProperties: [

api/src/Entity/Checklist.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,7 @@
3030
operations: [
3131
new Get(
3232
security: 'is_granted("CHECKLIST_IS_PROTOTYPE", object) or
33-
is_granted("CAMP_IS_PROTOTYPE", object) or
34-
is_granted("CAMP_IS_SHARED", object) or
33+
is_granted("CAMP_IS_PUBLIC", object) or
3534
is_granted("CAMP_COLLABORATOR", object)
3635
'
3736
),
@@ -64,8 +63,7 @@
6463
toProperty: 'camp',
6564
fromClass: Camp::class,
6665
security: 'is_granted("CAMP_COLLABORATOR", camp) or
67-
is_granted("CAMP_IS_SHARED", camp) or
68-
is_granted("CAMP_IS_PROTOTYPE", camp)'
66+
is_granted("CAMP_IS_PUBLIC", camp)'
6967
),
7068
],
7169
extraProperties: [

api/src/Entity/ChecklistItem.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@
3333
operations: [
3434
new Get(
3535
security: 'is_granted("CHECKLIST_IS_PROTOTYPE", object) or
36-
is_granted("CAMP_IS_PROTOTYPE", object) or
37-
is_granted("CAMP_IS_SHARED", object) or
36+
is_granted("CAMP_IS_PUBLIC", object) or
3837
is_granted("CAMP_COLLABORATOR", object)
3938
'
4039
),
@@ -65,8 +64,7 @@
6564
fromClass: Checklist::class,
6665
toProperty: 'checklist',
6766
security: 'is_granted("CHECKLIST_IS_PROTOTYPE", checklist) or
68-
is_granted("CAMP_IS_PROTOTYPE", checklist) or
69-
is_granted("CAMP_IS_SHARED", checklist) or
67+
is_granted("CAMP_IS_PUBLIC", checklist) or
7068
is_granted("CAMP_COLLABORATOR", checklist)'
7169
),
7270
],

api/src/Entity/Comment.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@
2727
operations: [
2828
new Get(
2929
security: 'is_granted("CAMP_COLLABORATOR", object) or
30-
is_granted("CAMP_IS_SHARED", object) or
31-
is_granted("CAMP_IS_PROTOTYPE", object) or
30+
is_granted("CAMP_IS_PUBLIC", object) or
3231
object.author === user',
3332
),
3433
new Delete(
@@ -49,8 +48,7 @@
4948
toProperty: 'activity',
5049
fromClass: Activity::class,
5150
security: 'is_granted("CAMP_COLLABORATOR", activity) or
52-
is_granted("CAMP_IS_SHARED", activity) or
53-
is_granted("CAMP_IS_PROTOTYPE", activity)',
51+
is_granted("CAMP_IS_PUBLIC", activity)',
5452
),
5553
],
5654
security: 'is_fully_authenticated()',

api/src/Entity/ContentNode/ChecklistNode.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@
2424
operations: [
2525
new Get(
2626
security: 'is_granted("CAMP_COLLABORATOR", object) or
27-
is_granted("CAMP_IS_SHARED", object) or
28-
is_granted("CAMP_IS_PROTOTYPE", object)'
27+
is_granted("CAMP_IS_PUBLIC", object)'
2928
),
3029
new Patch(
3130
processor: ChecklistNodePersistProcessor::class,

0 commit comments

Comments
 (0)