Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/Settings/register.d/catalog-ratings.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"group": "public",
"match": {
"status": "approved"
}
},
"crossOrganisation": true
},
"aanbod-beheerder",
"ambtenaar",
Expand Down
15 changes: 10 additions & 5 deletions lib/Settings/register.d/publication-field-rules.json
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,15 @@
"modulePublicationDate": {
"$lte": "$now"
}
}
},
"crossOrganisation": true
},
{
"group": "public",
"match": {
"moduleRegisteredBy": "Supplier"
}
},
"crossOrganisation": true
}
]
}
Expand Down Expand Up @@ -451,7 +453,8 @@
"group": "gebruik-beheerder",
"match": {
"consumer": "$organisation"
}
},
"crossOrganisation": true
},
{
"group": "aanbod-beheerder",
Expand All @@ -463,15 +466,17 @@
"group": "aanbod-beheerder",
"match": {
"provider": "$organisation"
}
},
"crossOrganisation": true
},
{
"group": "public",
"match": {
"publicationDate": {
"$lte": "$now"
}
}
},
"crossOrganisation": true
}
]
}
Expand Down
70 changes: 41 additions & 29 deletions lib/Settings/softwarecatalogus_register.json
Original file line number Diff line number Diff line change
Expand Up @@ -1091,7 +1091,7 @@
"aanbod-beheerder"
],
"read": [
"public",
{"group": "public", "crossOrganisation": true},
"aanbod-beheerder",
"ambtenaar",
"functioneel-beheerder",
Expand Down Expand Up @@ -1270,7 +1270,7 @@
"aanbod-beheerder"
],
"read": [
"public",
{"group": "public", "crossOrganisation": true},
"aanbod-beheerder",
"ambtenaar",
"functioneel-beheerder",
Expand Down Expand Up @@ -1559,7 +1559,8 @@
"publicationDate": {
"$lte": "$now"
}
}
},
"crossOrganisation": true
},
"aanbod-beheerder",
"ambtenaar",
Expand Down Expand Up @@ -1735,7 +1736,7 @@
"aanbod-beheerder"
],
"read": [
"public",
{"group": "public", "crossOrganisation": true},
"aanbod-beheerder",
"ambtenaar",
"functioneel-beheerder",
Expand Down Expand Up @@ -2427,7 +2428,8 @@
"publicationDate": {
"$lte": "$now"
}
}
},
"crossOrganisation": true
},
{
"group": "aanbod-beheerder",
Expand All @@ -2440,21 +2442,24 @@
"match": {
"registeredBy": "Supplier",
"status": "Active"
}
},
"crossOrganisation": true
},
{
"group": "public",
"match": {
"type": "Municipality",
"status": "Active"
}
},
"crossOrganisation": true
},
{
"group": "public",
"match": {
"type": "Collaboration",
"status": "Active"
}
},
"crossOrganisation": true
}
],
"update": [
Expand Down Expand Up @@ -3054,7 +3059,8 @@
"group": "gebruik-beheerder",
"match": {
"consumer": "$organisation"
}
},
"crossOrganisation": true
},
{
"group": "aanbod-beheerder",
Expand All @@ -3066,7 +3072,8 @@
"group": "aanbod-beheerder",
"match": {
"provider": "$organisation"
}
},
"crossOrganisation": true
}
],
"update": [
Expand Down Expand Up @@ -3379,8 +3386,8 @@
"aanbod-beheerder"
],
"read": [
"ambtenaar",
"software-catalog-admins",
{"group": "ambtenaar", "crossOrganisation": true},
{"group": "software-catalog-admins", "crossOrganisation": true},
{"group": "functioneel-beheerder", "match": {"_organisation": "$organisation"}},
{"group": "gebruik-beheerder", "match": {"_organisation": "$organisation"}},
{"group": "vng-raadpleger", "match": {"_organisation": "$organisation"}},
Expand Down Expand Up @@ -3772,7 +3779,8 @@
"publicationDate": {
"$lte": "$now"
}
}
},
"crossOrganisation": true
},
{
"group": "aanbod-beheerder",
Expand All @@ -3784,7 +3792,8 @@
"group": "aanbod-beheerder",
"match": {
"provider": "$organisation"
}
},
"crossOrganisation": true
}
],
"update": [
Expand Down Expand Up @@ -4011,7 +4020,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -5135,7 +5144,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -5458,7 +5467,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -5816,7 +5825,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -5950,7 +5959,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -6353,7 +6362,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -6886,7 +6895,8 @@
"publicationDate": {
"$lte": "$now"
}
}
},
"crossOrganisation": true
},
{
"group": "aanbod-beheerder",
Expand All @@ -6898,7 +6908,8 @@
"group": "public",
"match": {
"registeredBy": "Supplier"
}
},
"crossOrganisation": true
}
]
},
Expand Down Expand Up @@ -7080,7 +7091,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -7210,7 +7221,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -7450,7 +7461,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -7619,7 +7630,7 @@
"groups": null,
"authorization": {
"read": [
"public"
{"group": "public", "crossOrganisation": true}
]
},
"configuration": {
Expand Down Expand Up @@ -7848,7 +7859,7 @@
"aanbod-beheerder"
],
"read": [
"software-catalog-admins",
{"group": "software-catalog-admins", "crossOrganisation": true},
{
"group": "organisatie-beheerder",
"match": {
Expand Down Expand Up @@ -7883,7 +7894,8 @@
"group": "aanbod-beheerder",
"match": {
"provider": "$organisation"
}
},
"crossOrganisation": true
}
],
"update": [
Expand Down Expand Up @@ -8197,7 +8209,7 @@
"aanbod-beheerder"
],
"read": [
"public"
{"group": "public", "crossOrganisation": true}
],
"update": [
"software-catalog-admins",
Expand Down
2 changes: 1 addition & 1 deletion tests/Unit/Service/BioComplianceRegisterShapeTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function testBioMaatregelSchemaExists(): void {
}

$this->assertSame(expected: ['BBN1', 'BBN2', 'BBN3'], actual: $props['bbnLevel']['items']['enum'] ?? null);
$this->assertContains(needle: 'public', haystack: $bioMeasure['authorization']['read'] ?? []);
$this->assertContains(needle: ['group' => 'public', 'crossOrganisation' => true], haystack: $bioMeasure['authorization']['read'] ?? []);
}//end testBioMaatregelSchemaExists()

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,13 @@ public function testTheReviewSchemaPublicReadIsGatedOnApproved(): void {
$read,
'a bare public read makes every pending and rejected review world-readable'
);
$this->assertNotContains(
['group' => 'public', 'crossOrganisation' => true],
$read,
'an unconditional public read makes every pending and rejected review world-readable'
);
$this->assertContains(
['group' => 'public', 'match' => ['status' => 'approved']],
['group' => 'public', 'match' => ['status' => 'approved'], 'crossOrganisation' => true],
$read,
'anonymous readers must see approved reviews and only those'
);
Expand All @@ -165,9 +170,9 @@ public function testTheBaseRegisterIsUngatedWithoutTheFragment(): void {
$read = $base['components']['schemas'][ReviewService::REVIEW_TYPE]['authorization']['read'];

$this->assertContains(
'public',
['group' => 'public', 'crossOrganisation' => true],
$read,
'the base is expected to carry the bare public read that the fragment removes; '
'the base is expected to carry the unconditional public read that the fragment removes; '
.'if the base has been gated directly, this test and the fragment are now redundant'
);

Expand Down
8 changes: 5 additions & 3 deletions tests/Unit/Settings/AiSystemFragmentTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,12 @@ public function testReadsAreScopedToTheOrganisation(): void {
$read = $this->schema()['authorization']['read'];

$this->assertContains(['group' => 'gebruik-beheerder', 'match' => ['_organisation' => '$organisation']], $read);
$this->assertContains(['group' => 'aanbod-beheerder', 'match' => ['provider' => '$organisation']], $read);
$this->assertContains(['group' => 'aanbod-beheerder', 'match' => ['provider' => '$organisation'], 'crossOrganisation' => true], $read);
$this->assertContains(['group' => 'software-catalog-admins', 'crossOrganisation' => true], $read);
foreach ($read as $rule) {
if (is_string($rule) === true) {
$this->assertSame('software-catalog-admins', $rule, 'only the catalogue admins read every AI system');
$this->assertIsArray($rule, 'a bare group rule reads only the own organisation');
if (($rule['crossOrganisation'] ?? false) === true && isset($rule['match']) === false) {
$this->assertSame('software-catalog-admins', $rule['group'], 'only the catalogue admins read every AI system');
}
}

Expand Down
Loading
Loading