Waht would be a good way, using either EntityFramework methods or else, to validate that the credentials given have enough rights to do CRUD actions on the database?
Asked
Active
Viewed 89 times
0
-
2Attempt the CRUD actions and catch any exceptions thrown? – Chris Pickford Jan 31 '17 at 14:45
2 Answers
-3
You could use the System.Web.Mvc.AuthorizeAttribute
attribute which is used to restrict access by callers to an action method.
Here it is an example that shows you how to create a custom AuthorizeAttribute
: https://stackoverflow.com/a/11494091/5914627
https://msdn.microsoft.com/en-us/library/system.web.mvc.authorizeattribute(v=vs.108).aspx

Community
- 1
- 1

Felipe Cruz
- 1,119
- 10
- 18
-
2
-
1The question asks about an checking that application using Entity Framework has permissions on a database. This answer is about restricting users of an ASP.NET web application. The two scenarios are completely unrelated. – anaximander Jan 31 '17 at 15:29