Swap 3250 post dataset with explicit pid #518
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR aims to add the feature of creating datasets with explicit PID. There are few environmental variables introduced here and their purpose is:
As a user:
If I belong to a group that is listed as admin group (ADMIN_GROUPS), I can create a dataset with explicit pid
if I belong to a group that is listed in CREATE_DATASET_WITH_PID_GROUPS, I can create a dataset with explicit pid
if I belong to a group that is listed in CREATE_DATASET_GROUPS, I can create a dataset without pid. PID is assigned by the system
In usecase 1 and 2, if pid is not provided, the system automatically assigned a uuid v4 as dataset pid.
In use case 3, pid is automatically assigned as a uuid v4.
When pid is explicitly provided, the system should check that it is unique in the database.
If DATASET_CREATION_VALIDATION_ENABLED is set to TRUE, the system should validate the pid provided using the regex provided in DATASET_CREATION_VALIDATION_REGEX.
These configuration options should have the following default values:
Motivation
There was no option to create dataset with some explicit PID that is not generated by the system.
Fixes:
Changes:
Tests included/Docs Updated?