I am using Dynamic data and Domain data source. I have a column 'State' of EnumDataType which should be visible only to users in a particular role. But adding attribute like [RequiresAuthentication] and [RequiresRole] does not hide the field on the list
page or on the details page.
Can you please help me in letting me know what am I missing? Am I using the attributes correctly?
Thanks Steve, A quick question though is it possible to hide a particular column for unauthenticated users? I have tried hard without much help.
As per your sample, the attribute takes a parameter role for the currently logged in user.
What I am trying to do is hide the column for a Guest visitor and show it only for a logged in user. I don't want to make a compulsion that all the users of the site must be logged in.
subodh9312
Member
22 Points
19 Posts
Hiding a particular field for only authenticated users
Mar 14, 2012 04:18 AM|LINK
Hi,
I am using Dynamic data and Domain data source. I have a column 'State' of EnumDataType which should be visible only to users in a particular role. But adding attribute like [RequiresAuthentication] and [RequiresRole] does not hide the field on the list page or on the details page.
Can you please help me in letting me know what am I missing? Am I using the attributes correctly?
Thanks for the help.
sjnaughton
All-Star
27318 Points
5458 Posts
MVP
Re: Hiding a particular field for only authenticated users
Mar 14, 2012 09:54 PM|LINK
hi there see my article here Securing Dynamic Data 4 (Replay)
Always seeking an elegant solution.
subodh9312
Member
22 Points
19 Posts
Re: Hiding a particular field for only authenticated users
Mar 16, 2012 02:12 PM|LINK
Thanks Steve, A quick question though is it possible to hide a particular column for unauthenticated users? I have tried hard without much help.
As per your sample, the attribute takes a parameter role for the currently logged in user.
What I am trying to do is hide the column for a Guest visitor and show it only for a logged in user. I don't want to make a compulsion that all the users of the site must be logged in.
Thanks for the help.
sjnaughton
All-Star
27318 Points
5458 Posts
MVP
Re: Hiding a particular field for only authenticated users
Mar 16, 2012 02:17 PM|LINK
That is exactly what my sample does, it allows you to make a column read-only base on role and or even hide the column based on role.
Always seeking an elegant solution.