Last post Mar 11, 2009 02:01 PM by sjnaughton
Mar 11, 2009 09:25 AM|JJ60764|LINK
I have a demo application written based on the "Bits" example of dynamic attribute security. This example provides security at the table and column level. What if I need to provide security at the view level?
If, in our scenario, we say that we are using the ubiquitous Northwind database, Customers table and we want certain users to only see a portion of that data. To further illustrate, say we had a "CustomerService" table that associated Customers (CustomerID)
with Users (UserID) to govern this relationship. Say there is a user roll that can only view customers that begin with the letter 'A'. (RoleName = "LetterA"). How would this be accomplished in DD?
ASP.NET Dynamic data security
ASP.NET Dynamic Data
Mar 11, 2009 09:53 AM|sjnaughton|LINK
Have a look at DynamicData - Limit Data Displayed By User on my blog it goes along with my Permission based roles example. I don't
know if you are using that, the above example could be used to filter based on roles or user id.
Mar 11, 2009 10:14 AM|JJ60764|LINK
Thanks for your response. I'm not sure if a where parameter will do it in this case. If I have the Customers table and the Users table and a relationship created between them in a CustomerService table which contains CustomerID (many) and UserID (one) as
FK's, how would I be able to draw that out? Could I use a where clause similar to using the where parameter? I thought it would be more complicated since it might involve an inner join.
If the role condition is met, is there a way to "swap out" or manipulate the query as you can with the update, insert, delete partial methods that are created by default?
Would another possibility be to test the role condition and if that condition is met route the user to a custom page that uses an inner join query?
(I am incorporating your Attributes Tables example for role-based security, but kind of reached this issue as a sticking point)
Mar 11, 2009 02:01 PM|sjnaughton|LINK
Then have a look at Dynamic Data Filtering (by
Josh Heyes) project on codeplex and my article here
Dynamic Data Filtering – Installation this offers many of the features that are in the
Dyanmic Data Preview 2 also on codeplex.
Dynamic Data Filtering