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

Task: Implement entity-specific authorization helpers and add to relevant queries #220

Closed
2 of 4 tasks
emmbm opened this issue Oct 12, 2023 · 3 comments
Closed
2 of 4 tasks
Assignees

Comments

@emmbm
Copy link
Member

emmbm commented Oct 12, 2023

Task Description

The current database schema provides all that is needed for a granular data access control. Although, its use requires us to first ideate a future-proof system (query filters to use in where clauses?, query header injection with schema-level RLS?, etc.) and then implement reusable query helpers.

List of actions

  • Establish an authorization system and its level of implementation
  • Implement query helpers
  • Adjust current db schema (ONLY IF REQUIRED)
  • Apply to authorization system to queries across app
@emmbm
Copy link
Member Author

emmbm commented Oct 26, 2023

Chosen approach for now is to provide a module with helper filters (where values) or sub queries (select) that can then be added to existing queries. This enables for a modular building of queries with blocks from different concerns (retrieving translations, authorization, etc.).

See https://github.com/CUPUM/nplex/blob/v2/src/lib/db/authorization.server.ts for WIP.

@emmbm
Copy link
Member Author

emmbm commented Apr 3, 2024

Refer to https://github.com/CUPUM/aipithet/blob/main/src/lib/queries/queries.ts for an example of how to solve this.

@emmbm
Copy link
Member Author

emmbm commented Jun 17, 2024

RLS is coming soon to drizzle, but for the time being we will only rely on helper query filters and per-request authorization using the permission rules dictionnary.

@emmbm emmbm closed this as completed Jun 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant