Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests that demonstrate table-level permissions #59

Closed
simonw opened this issue Feb 18, 2024 · 1 comment
Closed

Tests that demonstrate table-level permissions #59

simonw opened this issue Feb 18, 2024 · 1 comment
Labels
documentation Improvements or additions to documentation tests
Milestone

Comments

@simonw
Copy link
Owner

simonw commented Feb 18, 2024

I built this for:

But in writing the release notes (#58) I realized the tests don't actually cover this yet. The documentation should mention it too.

@simonw simonw added documentation Improvements or additions to documentation tests labels Feb 18, 2024
@simonw simonw added this to the 0.8a0 milestone Feb 18, 2024
@simonw
Copy link
Owner Author

simonw commented Feb 18, 2024

I first did a round of manual testing:

sqlite-utils create-database sales.db
sqlite-utils create-database marketing.db
sqlite-utils create-table sales.db notes id integer --pk id
sqlite-utils create-table sales.db customers id integer --pk id
datasette -c perms.yml sales.db marketing.db --secret 1 --reload

Where perms.yml contained:

databases:
  marketing:
    permissions:
      create-table:
        id: pelican
      drop-table:
        id: pelican
      alter-table:
        id: pelican
  sales:
    tables:
      notes:
        permissions:
          alter-table:
            id: pelican

And I used a new datasette-unsafe-actor-debug plugin to help test.

This worked, though it did show me I need to fix this:

@simonw simonw closed this as completed in 03f7f53 Feb 18, 2024
simonw added a commit that referenced this issue Feb 18, 2024
simonw added a commit that referenced this issue Mar 14, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation tests
Projects
None yet
Development

No branches or pull requests

1 participant