Skip to main content

Configure permissions for Datasette 0.x in metadata.json

Project description

datasette-permissions-metadata

PyPI Changelog Tests License

Configure permissions for Datasette 0.x in metadata.json

Background

Datasette 1.0 will introduce a new way of configuring permissions using YAML or JSON directly in the Datasette datasette.yml configuration file.

This plugin makes a similar ability available to the Datasette 0.64+ series of releases, by allowing a permissions key to be added to the metadata.json or metadata.yml file used with that version of Datasette.

Installation

Install this plugin in the same environment as Datasette.

datasette install datasette-permissions-metadata

Configuration

To grant the upload-csvs permission (used by the datasette-upload-csvs plugin) to an user with an id of simon, add the following to metadata.json:

{
  "permissions": {
    "upload-csvs": {
      "id": "simon"
    }
  }
}

See the documentation on allow blocks for more details on this configuration format.

Development

To set up this plugin locally, first checkout the code. Then create a new virtual environment:

cd datasette-permissions-metadata
python3 -m venv venv
source venv/bin/activate

Now install the dependencies and test dependencies:

pip install -e '.[test]'

To run the tests:

pytest

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

datasette_permissions_metadata-0.1.tar.gz (6.7 kB view hashes)

Uploaded Source

Built Distribution

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