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

User Entities #40

Open
tsutomi opened this issue Oct 1, 2024 · 0 comments
Open

User Entities #40

tsutomi opened this issue Oct 1, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@tsutomi
Copy link
Member

tsutomi commented Oct 1, 2024

Entities within the scope of a tenant could be further segregated by the owner of the entity, which can be a user or an application of the tenant.

The current implementation of the repositories supports segregation by tenant, but when the repository is not per-tenant (or even when the tenant has users), this segregation would not happen.

A way of implementing user segregation would be to treat the user as a tenant, but this approach would go against the nature of multi-tenancy, and force Finbuckle Multi-Tenant implementation with some hacks.

Proposed Solution

  • Provide the contract IHasOwner that is used to determine the user owning the entity
  • Provide a contract to access the currently logged user of an application
  • When the entity managed by the repository implemented the IHasOwner, apply an additional filter that filters out the entities queried by the owner
  • When adding new entities in a repository that has no owner set, set the identifier of the currently logged user
  • Provide a method to bypass the owner filter (e.g. for administration purposes)
@tsutomi tsutomi added the enhancement New feature or request label Oct 1, 2024
@tsutomi tsutomi self-assigned this Oct 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant