SciCatProject / SciCatProject/backend
Ingestor is no more Dataset ingestor
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 27
- Forks
- 37
- Avg merge
- 17h 32m
- Merged PRs (30d)
- 38
Description
I would assume the main metadata class in SciCat is Dataset i.e. it describes the most inportant details of scans or runs. Therefore Ingestor should have possiblity to ingest Datasets. Unfortunately, after
https://github.com/SciCatProject/scicat-backend-next/pull/415/ where the to following lines where commented
--- a/src/casl/casl-ability.factory.ts
+++ b/src/casl/casl-ability.factory.ts
@@ -215,8 +215,8 @@ export class CaslAbilityFactory {
can(Action.Create, Attachment);
//cannot(Action.Delete, DatasetClass);
- can(Action.Create, DatasetClass);
- can(Action.Update, DatasetClass);
+ //can(Action.Create, DatasetClass);
+ //can(Action.Update, DatasetClass);
can(Action.Create, Instrument);
can(Action.Update, Instrument);
the ingestor is allowed to ingest only Instrument metadata unless it ingestor = ownerGroup or ingestor is in ADMIN_GROUPS.
At DESY in the old backend version we use ingestor account to ingest Dataset metadata where ownerGroup is our beamtime user group (different from ingestor). Also we don't want to set admin privileges to ingestor.
Therefore I would like to ask what was the reason to comment those two lines out and if it possible to revert the changes, i.e.
make ingestor back the ingestor.
If uncommenting the above lines contradicts other use-cases I would propose to define a new role e.g. datasetIngestor
which has permissions to create/update Datasets, i.e. similar to proposalIngestor for Proposals (This solution was originally proposed by Linus).
Other option would be to create a new env variable, e.g. CREATE_DATASET_PRIVILEGED_GROUP to switch the privileges (proposed by Max) . However, the latter solution look to me less readable.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/casl/casl-ability.factory.ts and the changes in pull request 415; read the issue discussion to understand why Dataset create and update permissions were commented out. Agree on whether to restore those permissions or introduce a separate dataset-ingestor role, then verify that the selected ingestor accounts can create and update Datasets without receiving admin privileges.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- authorization, backend
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100