0

We have a desktop application that uses a local database (SQL Server 2012 LocalDb).

We do not want the end user to be able to modify the database directly, and we want to restrict viewing the database contents to certain users.

Moreover, we want to restrict certain actions that can be performed from within the applications depending on the authorization level of the user that is logged in.

How can the first requirement be fulfilled? Is it possible through code-first?

Can the second requirement be integrated with the first?

1 Answer 1

1

Currently this is not supported out of the box, however since EF 6 you can create your own migration steps this way you could encapsulate granting rights to certain users and this way you can manage the user rights with migration steps.

About creating a migration step you can read this post: http://dolinkamark.wordpress.com/2014/05/03/creating-a-custom-migration-operation-in-entity-framework/

and you can find a post which has an example closer to your question: http://romiller.com/2013/02/27/ef6-writing-your-own-code-first-migration-operations/

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.