I am working on a project that requires custom granular security/privacy settings. Basically I need to be able to restrict access to data based on the user executing the query. Easy enough, right? Here a couple of gotchyas though..
- The users must be stored in a users table. Creating Windows user accounts, SQL server users or SQL server roles is unacceptable for this application.
- The security criteria has to be defined by any number of sources, i.e. a user's location, pay grade, specialty, etc..
Right now we're implementing this by generating a SQL "where" clause and appending it to the end of every query before it's executed. This restricts us from being able to leverage newer technologies such as Entity Framework and also carries with it its own other limitations and performance problems.
Any help or ideas would be greatly appreciated. Please let me know if additional clarification is needed.
Thanks! Jason