tu-graz-library / invenio-config-tugraz

invenio module that adds tugraz configs.
MIT License
3 stars 9 forks source link

AuthenticatedUser Generator #39

Closed mb-wali closed 3 years ago

mb-wali commented 3 years ago

AuthenticatedUser Generator

AIM

Implement a Generator (AuthenticatedUser), which will be used to create records - can_create

Create a new record with Access Token

curl -k -XPOST -H "Authorization: Bearer <your token>" -H "Content-Type: application/json" https://127.0.0.1:5000/api/records -d '{
    "access": {
        "access_right": "open",
        "files": false,
        "owned_by": [1],
        "metadata": false,
        "embargo_date": "2021-02-15"
    },
    "metadata": {
        "creators": [
            {
                "name": "Marcus Junius Brutus",
                "type": "personal",
                "given_name": "Marcus",
                "family_name": "Brutus",
                "identifiers": {
                    "orcid": "0000-0002-1825-0097"
                },
                "affiliations": [
                    {
                        "name": "Entity One",
                        "identifiers": {
                            "ror": "02ex6cf31"
                        }
                    }
                ]
            }
        ],
        "description": "A story about how permissions work.",
        "rights": [
            {
                "rights": "Berkeley Software Distribution 3",
                "uri": "https://opensource.org/licenses/BSD-3-Clause",
                "identifier": "BSD-3",
                "scheme": "BSD-3"
            }
        ],
        "publication_date": "2020-08-31",
        "resource_type": {
            "type": "image",
            "subtype": "image-photo"
        },
        "title": "A permission story",
        "version": "v0.0.1"
}
}'

Publish the record

curl -k -XPOST -H "Authorization: Bearer <your token>" -H "Content-Type: application/json" https://127.0.0.1:5000/api/records/47887-4d639/draft/actions/publish