datasette-permissions-metadata


Namedatasette-permissions-metadata JSON
Version 0.1 PyPI version JSON
download
home_pageNone
SummaryConfigure permissions for Datasette 0.x in metadata.json
upload_time2024-05-15 23:12:14
maintainerNone
docs_urlNone
authorSimon Willison
requires_python>=3.8
licenseApache-2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # datasette-permissions-metadata

[![PyPI](https://img.shields.io/pypi/v/datasette-permissions-metadata.svg)](https://pypi.org/project/datasette-permissions-metadata/)
[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-permissions-metadata?include_prereleases&label=changelog)](https://github.com/datasette/datasette-permissions-metadata/releases)
[![Tests](https://github.com/datasette/datasette-permissions-metadata/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-permissions-metadata/actions/workflows/test.yml)
[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-permissions-metadata/blob/main/LICENSE)

Configure permissions for Datasette 0.x in `metadata.json`

## Background

Datasette 1.0 will introduce [a new way of configuring permissions](https://docs.datasette.io/en/latest/authentication.html#other-permissions-in-datasette-yaml) 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.
```bash
datasette install datasette-permissions-metadata
```
## Configuration

To grant the `upload-csvs` permission (used by the [datasette-upload-csvs](https://datasette.io/plugins/datasette-upload-csvs) plugin) to an user with an `id` of `simon`, add the following to `metadata.json`:

```json
{
  "permissions": {
    "upload-csvs": {
      "id": "simon"
    }
  }
}
```
See [the documentation on allow blocks](https://docs.datasette.io/en/stable/authentication.html#defining-permissions-with-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:
```bash
cd datasette-permissions-metadata
python3 -m venv venv
source venv/bin/activate
```
Now install the dependencies and test dependencies:
```bash
pip install -e '.[test]'
```
To run the tests:
```bash
pytest
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "datasette-permissions-metadata",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": null,
    "author": "Simon Willison",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/65/a4/a036709c971d3e45da01401ba5f979ff14a9854b115af5890af3b6d73e85/datasette_permissions_metadata-0.1.tar.gz",
    "platform": null,
    "description": "# datasette-permissions-metadata\n\n[![PyPI](https://img.shields.io/pypi/v/datasette-permissions-metadata.svg)](https://pypi.org/project/datasette-permissions-metadata/)\n[![Changelog](https://img.shields.io/github/v/release/datasette/datasette-permissions-metadata?include_prereleases&label=changelog)](https://github.com/datasette/datasette-permissions-metadata/releases)\n[![Tests](https://github.com/datasette/datasette-permissions-metadata/actions/workflows/test.yml/badge.svg)](https://github.com/datasette/datasette-permissions-metadata/actions/workflows/test.yml)\n[![License](https://img.shields.io/badge/license-Apache%202.0-blue.svg)](https://github.com/datasette/datasette-permissions-metadata/blob/main/LICENSE)\n\nConfigure permissions for Datasette 0.x in `metadata.json`\n\n## Background\n\nDatasette 1.0 will introduce [a new way of configuring permissions](https://docs.datasette.io/en/latest/authentication.html#other-permissions-in-datasette-yaml) using YAML or JSON directly in the Datasette `datasette.yml` configuration file.\n\nThis 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.\n\n## Installation\n\nInstall this plugin in the same environment as Datasette.\n```bash\ndatasette install datasette-permissions-metadata\n```\n## Configuration\n\nTo grant the `upload-csvs` permission (used by the [datasette-upload-csvs](https://datasette.io/plugins/datasette-upload-csvs) plugin) to an user with an `id` of `simon`, add the following to `metadata.json`:\n\n```json\n{\n  \"permissions\": {\n    \"upload-csvs\": {\n      \"id\": \"simon\"\n    }\n  }\n}\n```\nSee [the documentation on allow blocks](https://docs.datasette.io/en/stable/authentication.html#defining-permissions-with-allow-blocks) for more details on this configuration format.\n\n## Development\n\nTo set up this plugin locally, first checkout the code. Then create a new virtual environment:\n```bash\ncd datasette-permissions-metadata\npython3 -m venv venv\nsource venv/bin/activate\n```\nNow install the dependencies and test dependencies:\n```bash\npip install -e '.[test]'\n```\nTo run the tests:\n```bash\npytest\n```\n",
    "bugtrack_url": null,
    "license": "Apache-2.0",
    "summary": "Configure permissions for Datasette 0.x in metadata.json",
    "version": "0.1",
    "project_urls": {
        "CI": "https://github.com/datasette/datasette-permissions-metadata/actions",
        "Changelog": "https://github.com/datasette/datasette-permissions-metadata/releases",
        "Homepage": "https://github.com/datasette/datasette-permissions-metadata",
        "Issues": "https://github.com/datasette/datasette-permissions-metadata/issues"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f4d03e3b61adba81afc5e0b1baf4cd0b4d1268dcfeabe225d20b5939236b1c8b",
                "md5": "bd8420239c8f8f1ca6276c433311e104",
                "sha256": "bcd0ca83ddb53c9f45ebf49cec5b91f1befe40f6cc1a3f3eda2108aa4535ecd4"
            },
            "downloads": -1,
            "filename": "datasette_permissions_metadata-0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "bd8420239c8f8f1ca6276c433311e104",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7113,
            "upload_time": "2024-05-15T23:12:13",
            "upload_time_iso_8601": "2024-05-15T23:12:13.401890Z",
            "url": "https://files.pythonhosted.org/packages/f4/d0/3e3b61adba81afc5e0b1baf4cd0b4d1268dcfeabe225d20b5939236b1c8b/datasette_permissions_metadata-0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "65a4a036709c971d3e45da01401ba5f979ff14a9854b115af5890af3b6d73e85",
                "md5": "0df8af834dae4756c5f34c90512bd4fa",
                "sha256": "55dd9465e58177d63299a5d522bda058a0608ee73f26a6767b0e50be9b52e328"
            },
            "downloads": -1,
            "filename": "datasette_permissions_metadata-0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "0df8af834dae4756c5f34c90512bd4fa",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 6737,
            "upload_time": "2024-05-15T23:12:14",
            "upload_time_iso_8601": "2024-05-15T23:12:14.721513Z",
            "url": "https://files.pythonhosted.org/packages/65/a4/a036709c971d3e45da01401ba5f979ff14a9854b115af5890af3b6d73e85/datasette_permissions_metadata-0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-15 23:12:14",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "datasette",
    "github_project": "datasette-permissions-metadata",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "datasette-permissions-metadata"
}
        
Elapsed time: 0.65666s