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

Add records access control example #39

Open
VitaliyMF opened this issue Apr 25, 2017 · 0 comments
Open

Add records access control example #39

VitaliyMF opened this issue Apr 25, 2017 · 0 comments
Labels

Comments

@VitaliyMF
Copy link
Contributor

Sometimes access to the database records should be controlled on a data layer. Typical situations:

  • SaaS applications that use single database for all "instances"; in this case data is isolated by adding something like "instance_id" or "client_id' in all tables. Data layer should guarantee that business logic will able to select/update/delete records only of the current "instance".

  • business apps where access to the records is controlled by some rules. For instance, someone should able to select a record only if it is "assigned" to this record.

NReco.Data supports this kind of access control; it is possible to add extra 'access control' conditons to the Query before execution by wrapping IDbCommandBuilder (responsible for ADO.NET commands generation by Query). Lets add simple example to illustrate this approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant