Skip to main content

Introduces or lifts restrictions (authorization) for managing data and metadata on DCOR

Project description

This module introduces/lifts restrictions (authorization) for the management of data and meta data on DCOR. The corresponding UI elements are modified accordingly:

  • Authorization (auth.py)

    • allow all logged-in users to create datasets, labs, and collections

    • do not allow deleting datasets or resources unless they are drafts

    • allow purging of deleted datasets

    • do not allow adding resources to active datasets

    • do not allow bulk_update_delete (e.g. datasets by organization admins)

    • dataset: do not allow switching to a more restrictive license

    • dataset: do not allow changing the name (slug)

    • resource: only allow changing the “description”

    • Do not allow uploading resources with the same name (ckanext-dcor_depot)

    • Allow adding resources up to 3h after creating dataset

    • Do not allow setting a resource id when uploading

  • Permissions (plugin.py)

    • Allow a user A to see user B’s private dataset if the private dataset is in a group that user A is a member of.

  • Validation (validate.py)

    • Do not allow setting a different resource name when uploading

    • Do not allow weird characters in resource names

    • Restrict to basic CC licenses

    • Author list “authors” is CSV

    • Parse DOI field (remove URL part)

    • Automatically generate dataset name (slug) using random characters if necessary (does not apply to admins)

    • restrict upload data extensions to .rtdc, .csv, .tsv, .pdf, .txt, .png, .jpg, .tif, .py, .ipynb

    • Force user to select a license

    • Do not allow non-admins to set the visibility of a public dataset to private

    • Configuration metadata (using dclab.dfn.config_funcs)

    • A dataset is considered to be a draft when it does not contain resources (validate.state)

    • Allow to delete draft datasets

  • UI Dataset:

    • hide “add new resource” button in templates/package/resources.html

    • remove url, version, author, author_email, maintainer, maintainer_email (templates/package/snippets/package_metadata_fields.html)

    • remove custom extras (user should use resource schema supplements instead)

    • add field authors (csv list)

    • add field doi (validator parses URLs)

    • add field references (parses arxiv, bioRxiv, DOI, links)

    • add CC license file licenses.json (only show less restrictive licenses when editing the dataset)

    • hide name (slug) editing form

    • dataset visibility is public by default

  • UI Organization:

    • remove “Delete” button in bulk view

  • UI Resource:

    • Resource: remove “URL” button when creating a resource (only upload makes sense) (fanstatic/dcor_schemas_data_upload.js and templates/package/snippets/resource_form.html)

    • Do not show variables these variables (because they are redundant): [‘last modified’, ‘revision id’, ‘url type’, ‘state’, ‘on same domain’] (templates/package/resource_read.html)

    • Show DC config data via “toggle-more”

    • Add supplementary resource schema via json files located in dcor_schemas/resource_schema_supplements

  • Background jobs:

    • set the mimetype for each dataset

    • populate “dc:sec:key” metadata for each DC dataset

    • generates sha256 hash upon resource creation

  • Configuration keywords:

    • the ckanext.dcor_schemas.json_resource_schema_dir parameter can be used to specify a directory containing .json files that define the supplementary resource schema. The default is package which means that the supplementary resource schema of this extension is used.

  • API extensions:

    • resource_schema_supplements returns a dictionary of the current supplementary resource schema

    • supported_resource_suffixes returns a list of supported resource suffixes

  • CLI:

    • add CKAN command list-zombie-users for users with no datasets and no activity for a certain amount of time

Installation

Simply run

pip install ckanext-dcor_schemas

In the configuration file ckan.ini:

ckan.plugins = [...] dcor_schemas
ckan.extra_resource_fields = sha256

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ckanext-dcor_schemas-0.11.2.tar.gz (38.5 kB view details)

Uploaded Source

Built Distribution

ckanext_dcor_schemas-0.11.2-py3-none-any.whl (44.6 kB view details)

Uploaded Python 3

File details

Details for the file ckanext-dcor_schemas-0.11.2.tar.gz.

File metadata

  • Download URL: ckanext-dcor_schemas-0.11.2.tar.gz
  • Upload date:
  • Size: 38.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ckanext-dcor_schemas-0.11.2.tar.gz
Algorithm Hash digest
SHA256 4925e5a6b0dc94e60d878ef2c9c3b2743d6ebbc676868cf628d76a2301ea7d05
MD5 1639b19f804fc60b51b29fd5d8d1cc96
BLAKE2b-256 82f599309b51cea606cc1ad5197d1d81cb2d7d2770bc78f6f103023ae6935cbc

See more details on using hashes here.

File details

Details for the file ckanext_dcor_schemas-0.11.2-py3-none-any.whl.

File metadata

  • Download URL: ckanext_dcor_schemas-0.11.2-py3-none-any.whl
  • Upload date:
  • Size: 44.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/49.2.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.9.1

File hashes

Hashes for ckanext_dcor_schemas-0.11.2-py3-none-any.whl
Algorithm Hash digest
SHA256 37665db80fd54d079387d4b0a32b2dff305ed0a29743cba16cca18906c43b53e
MD5 9f5307ea35ff30c7f6c160dcd0ca17d9
BLAKE2b-256 c96ae33daf143d5304bc6172d5067f8488f2d8ee30fa758e6188e67afc38b5e3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page