Skip to content

Refactor permissions and add unit tests #68

@ecton

Description

@ecton

After adding permissions in #51, we ended up with an automatically checked permissions layer at the API level in PliantDb. This layer can be extended into the custom API. This sounded like a great way to bootstrap the permissions system, and it was.

But, there was an option when doing this: first was to just use actionable for the custom API but implement permissions inside of PliantDb separately. The question was: did I want to support permission-restrictions on local database operations? At the time, I thought it would purely be for unit testing, so I opted not to.

Since then, I have realized that I do want it for unit tests, but also for general purpose application development. When thinking of a database application that doesn't need to allow clients to connect to the database over a network, if you aren't allowed to define permission models and enforce them, you'll have a host of new problems if you decide to switch in the future.

This issue is to track a refactor moving permissions checks into pliantdb-local.

  • Add unit tests for all current permission checks.
  • Modify current dispatchers in Server to use none protection.
  • Re-implement permission checks in pliantdb-local using effective_permissions from Add User Authentication #64.
  • Make Database::with_effective_permissions() public.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or requestmultiuserIssues impacting multi-user support

Type

No type

Projects

Status

Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions