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?

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Dabblernl
  • 15,831
  • 18
  • 96
  • 148

1 Answers1

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/

Márk Gergely Dolinka
  • 1,430
  • 2
  • 11
  • 22