Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MODSOURCE-796 Cleanup permissions #646

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 13 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
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
1 change: 1 addition & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
* [MODSOURCE-752](https://folio-org.atlassian.net/browse/MODSOURCE-752) Emit Domain Events For Source Records
* [MODSOURCE-795](https://folio-org.atlassian.net/browse/MODSOURCE-795) Upgrade Spring 5 to 6 by 2024-08-31
* [MODSOURMAN-1203](https://folio-org.atlassian.net/browse/MODSOURMAN-1203) Add validation on MARC_BIB record save
* [MODSOURCE-796](https://folio-org.atlassian.net/browse/MODSOURCE-796) Fix inconsistencies in permission namings

## 2024-03-20 5.8.0
* [MODSOURCE-733](https://issues.folio.org/browse/MODSOURCE-733) Reduce Memory Allocation of Strings
Expand Down
169 changes: 125 additions & 44 deletions descriptors/ModuleDescriptor-template.json
julianladisch marked this conversation as resolved.
Show resolved Hide resolved
julianladisch marked this conversation as resolved.
Show resolved Hide resolved
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ensure to update the module descriptor/package.json of all modules that call a mod-source-record-storage API protected by a renamed permission.
I've started a TODOs list in this PR's description.

Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
],
"pathPattern": "/source-storage/snapshots",
"permissionsRequired": [
"source-storage.snapshots.get"
"source-storage.snapshots.collection.get"
]
},
{
Expand All @@ -30,7 +30,7 @@
],
"pathPattern": "/source-storage/snapshots/{jobExecutionId}",
"permissionsRequired": [
"source-storage.snapshots.get"
"source-storage.snapshots.item.get"
]
},
{
Expand Down Expand Up @@ -62,7 +62,7 @@
],
"pathPattern": "/source-storage/records",
"permissionsRequired": [
"source-storage.records.get"
"source-storage.records.collection.get"
]
},
{
Expand All @@ -80,7 +80,7 @@
],
"pathPattern": "/source-storage/records/{id}",
"permissionsRequired": [
"source-storage.records.get"
"source-storage.records.item.get"
]
},
{
Expand All @@ -98,7 +98,7 @@
],
"pathPattern": "/source-storage/records/{id}/generation",
"permissionsRequired": [
"source-storage.records.put"
"source-storage.records.generation.item.put"
]
},
{
Expand All @@ -116,7 +116,7 @@
],
"pathPattern": "/source-storage/records/{id}/formatted",
"permissionsRequired": [
"source-storage.records.get"
"source-storage.records.formatted.item.get"
]
},
{
Expand All @@ -134,7 +134,7 @@
],
"pathPattern": "/source-storage/records/matching",
"permissionsRequired": [
"source-storage.records.get"
"source-storage.records.matching.collection.post"
]
}
]
Expand All @@ -149,7 +149,7 @@
],
"pathPattern": "/source-storage/source-records",
"permissionsRequired": [
"source-storage.sourceRecords.get"
"source-storage.source-records.collection.get"
]
},
{
Expand All @@ -158,7 +158,7 @@
],
"pathPattern": "/source-storage/source-records/{id}",
"permissionsRequired": [
"source-storage.sourceRecords.get"
"source-storage.source-records.item.get"
]
}
]
Expand All @@ -173,7 +173,7 @@
],
"pathPattern": "/source-storage/populate-test-marc-records",
"permissionsRequired": [
"source-storage.populate.records"
"source-storage.records.populate.collection.post"
]
}
]
Expand All @@ -188,7 +188,7 @@
],
"pathPattern": "/source-storage/stream/records",
"permissionsRequired": [
"source-storage.records.get"
"source-storage.stream.records.collection.get"
]
},
{
Expand All @@ -197,7 +197,7 @@
],
"pathPattern": "/source-storage/stream/source-records",
"permissionsRequired": [
"source-storage.sourceRecords.get"
"source-storage.stream.source-records.collection.get"
]
},
{
Expand All @@ -206,7 +206,7 @@
],
"pathPattern": "/source-storage/stream/marc-record-identifiers",
"permissionsRequired": [
"source-storage.records.get"
"source-storage.stream.marc-record-identifiers.collection.post"
]
}
]
Expand All @@ -221,7 +221,7 @@
],
"pathPattern": "/source-storage/batch/records",
"permissionsRequired": [
"source-storage.records.post"
"source-storage.batch.records.collection.post"
]
},
{
Expand All @@ -230,7 +230,7 @@
],
"pathPattern": "/source-storage/batch/parsed-records",
"permissionsRequired": [
"source-storage.records.put"
"source-storage.parsed-records.collection.put"
]
},
{
Expand All @@ -239,7 +239,7 @@
],
"pathPattern": "/source-storage/batch/parsed-records/fetch",
"permissionsRequired": [
"source-storage.records.fetch"
"source-storage.parsed-records.fetch.collection.post"
]
},
{
Expand All @@ -248,7 +248,7 @@
],
"pathPattern": "/source-storage/batch/verified-records",
"permissionsRequired": [
"source-storage.verified.records"
"source-storage.verified-records.collection.post"
]
}
]
Expand All @@ -265,7 +265,7 @@
{
"methods": ["GET"],
"pathPattern": "/source-storage/migrations/jobs/{id}",
"permissionsRequired": ["source-storage.migrations.get"]
"permissionsRequired": ["source-storage.migrations.item.get"]
}
]
},
Expand Down Expand Up @@ -309,14 +309,22 @@
],
"permissionSets": [
{
"permissionName": "source-storage.populate.records",
"permissionName": "source-storage.records.populate.collection.post",
"displayName": "Source Storage - populate storage with test records",
"description": "Populate storage with test records"
"description": "Populate storage with test records",
"replaces": ["source-storage.populate.records"]
},
{
"permissionName": "source-storage.snapshots.item.get",
"displayName": "Source Storage - get snapshot",
"description": "Get Snapshot",
"replaces": ["source-storage.snapshots.get"]
},
{
"permissionName": "source-storage.snapshots.get",
"displayName": "Source Storage - get snapshot(s)",
"description": "Get Snapshot(s)"
"permissionName": "source-storage.snapshots.collection.get",
"displayName": "Source Storage - get snapshots",
"description": "Get Snapshots",
"replaces": ["source-storage.snapshots.get"]
},
{
"permissionName": "source-storage.snapshots.post",
Expand All @@ -333,11 +341,6 @@
"displayName": "Source Storage - delete snapshot and records",
"description": "Delete Snapshot and all related Records"
},
{
"permissionName": "source-storage.records.get",
"displayName": "Source Storage - get record(s)",
"description": "Get Record(s)"
},
{
"permissionName": "source-storage.records.post",
"displayName": "Source Storage - create new record",
Expand All @@ -349,9 +352,37 @@
"description": "Put Record"
},
{
"permissionName": "source-storage.records.fetch",
"displayName": "Source Storage - fetch record",
"description": "Fetch Record"
"permissionName": "source-storage.records.generation.item.put",
"displayName": "Source Storage - update record's generation",
"description": "Update record's generation"
},
{
"permissionName": "source-storage.parsed-records.collection.put",
"displayName": "Source Storage - update records",
"description": "Update records"
},
{
"permissionName": "source-storage.parsed-records.fetch.collection.post",
"displayName": "Source Storage - fetch records",
"description": "Fetch Records",
"replaces": ["source-storage.records.fetch"]
},
{
"permissionName": "source-storage.batch.records.collection.post",
"displayName": "Source Storage - stream collection of records",
"description": "Stream collection of records"
},
{
"permissionName": "source-storage.stream.source-records.collection.get",
"displayName": "Source Storage - get results",
"description": "Source Storage - get results",
"replaces": ["source-storage.sourceRecords.get"]
},
{
"permissionName": "source-storage.stream.marc-record-identifiers.collection.post",
"displayName": "Source Storage - post record's identifiers",
"description": "Post record's identifiers",
"replaces": ["source-storage.records.get"]
},
{
"permissionName": "source-storage.records.update",
Expand All @@ -364,12 +395,49 @@
"description": "Delete Record"
},
{
"permissionName": "source-storage.sourceRecords.get",
"displayName": "Source Storage - get results",
"description": "Get Results"
"permissionName": "source-storage.source-records.item.get",
"displayName": "Source Storage - get source record",
"description": "Get Source Record",
"replaces": ["source-storage.sourceRecords.get"]
},
{
"permissionName": "source-storage.records.collection.get",
"displayName": "Source Storage - get records",
"description": "Get Records",
"replaces": ["source-storage.records.get"]
},
{
"permissionName": "source-storage.records.item.get",
"displayName": "Source Storage - get record",
"description": "Get Record",
"replaces": ["source-storage.records.get"]
},
{
"permissionName": "source-storage.source-records.collection.get",
"displayName": "Source Storage - get source record collection",
"description": "Get Source Records",
"replaces": ["source-storage.sourceRecords.get"]
},
{
"permissionName": "source-storage.records.formatted.item.get",
"displayName": "Source Storage - get formatter record",
"description": "Get formatted Record",
"replaces": ["source-storage.records.get"]
},
{
"permissionName": "source-storage.stream.records.collection.get",
"displayName": "Source Storage - stream record",
"description": "Stream record",
"replaces": ["source-storage.records.get"]
},
{
"permissionName": "source-storage.records.matching.collection.post",
"displayName": "Source Storage - get pairs of marc record ID to external entity ID",
"description": "Get pairs of marc record ID to external entity ID",
"replaces": ["source-storage.records.get"]
},
{
"permissionName": "source-storage.verified.records",
"permissionName": "source-storage.verified-records.collection.post",
"displayName": "Source Storage - validate marc bib ids in the system",
"description": "Return marc bib ids, which doesn't exist in the system"
},
Expand All @@ -379,30 +447,43 @@
"description": "Initiate asynchronous migration job"
},
{
"permissionName": "source-storage.migrations.get",
"permissionName": "source-storage.migrations.item.get",
"displayName": "Source Storage - get migration job(s)",
"description": "Get migration job(s)"
"description": "Get migration job(s)",
"replaces": ["source-storage.migrations.get"]
},
{
"permissionName": "source-storage.all",
"displayName": "Source Record Storage - all permissions",
"description": "Entire set of permissions needed to manage snapshots and records",
"subPermissions": [
"source-storage.populate.records",
"source-storage.snapshots.get",
"source-storage.records.populate.collection.post",
"source-storage.snapshots.item.get",
"source-storage.snapshots.collection.get",
"source-storage.snapshots.post",
"source-storage.snapshots.put",
"source-storage.snapshots.delete",
"source-storage.records.get",
"source-storage.records.post",
"source-storage.records.put",
"source-storage.records.fetch",
"source-storage.parsed-records.fetch.collection.post",
"source-storage.records.delete",
"source-storage.records.update",
"source-storage.sourceRecords.get",
"source-storage.verified.records",
"source-storage.source-records.item.get",
"source-storage.source-records.collection.get",
"source-storage.verified-records.collection.post",
"source-storage.migrations.post",
"source-storage.migrations.get"
"source-storage.migrations.item.get",
"source-storage.records.generation.item.put",
"source-storage.parsed-records.collection.put",
"source-storage.batch-records.collection.post",
"source-storage.batch.records.collection.post",
"source-storage.stream.source-records.collection.get",
"source-storage.records.formatted.item.get",
"source-storage.stream.marc-record-identifiers.collection.post",
"source-storage.records.item.get",
"source-storage.records.collection.get",
"source-storage.stream.records.collection.get",
"source-storage.records.matching.collection.post"
],
"visible": false
}
Expand Down