<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET Dynamic Data</title><link>http://forums.asp.net/1145.aspx</link><description>Discussions regarding the new scaffolding framework in ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: A DynamicData Attribute Based Permission Solution using User Roles</title><link>http://forums.asp.net/thread/2484727.aspx</link><pubDate>Fri, 11 Jul 2008 23:34:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2484727</guid><dc:creator>asrfarinha</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2484727.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2484727</wfw:commentRss><description>&lt;p&gt;&lt;BLOCKQUOTE&gt;&lt;div&gt;&lt;img src="/Themes/fan/images/icon-quote.gif"&gt; &lt;strong&gt;marcind:&lt;/strong&gt;&lt;/div&gt;&lt;div&gt;&lt;/p&gt;&lt;p&gt;Have you looked at the &lt;a href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14475" class=""&gt;Dynamic Data Futures&lt;/a&gt; project. It has examples of how to declare column ordering (by using a custom field tempalte generator) as well as how to hide columns for insert scenarios.&lt;/p&gt;&lt;p&gt;&lt;/div&gt;&lt;/BLOCKQUOTE&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I did now, thanks for pointing me to it.&lt;/p&gt;&lt;p&gt;In short: using the AdvancedFieldGenerator and the ColumnOrderAttribute.&lt;/p&gt;&lt;p&gt;But what if I need different orderings for different types of pages? eheheheh (kidding)&lt;/p&gt;&lt;p&gt;Anyway, I&amp;#39;m now wondering if the advantage of having the columns autogenerated is significant enough to do it all over again (I already edited the custom pages and now I would have to delete that and add the ColumnOrderAttribute to all the columns...). And maybe the logic for disabling certain controls and hiding certain fields based on the role will make it all very confusing... &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: A DynamicData Attribute Based Permission Solution using User Roles</title><link>http://forums.asp.net/thread/2484678.aspx</link><pubDate>Fri, 11 Jul 2008 22:53:27 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2484678</guid><dc:creator>marcind</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2484678.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2484678</wfw:commentRss><description>&lt;p&gt;Have you looked at the &lt;a class="" href="http://www.codeplex.com/aspnet/Release/ProjectReleases.aspx?ReleaseId=14475"&gt;Dynamic Data Futures&lt;/a&gt; project. It has examples of how to declare column ordering (by using a custom field tempalte generator) as well as how to hide columns for insert scenarios.&lt;/p&gt;</description></item><item><title>Re: A DynamicData Attribute Based Permission Solution using User Roles</title><link>http://forums.asp.net/thread/2484662.aspx</link><pubDate>Fri, 11 Jul 2008 22:45:57 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2484662</guid><dc:creator>asrfarinha</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2484662.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2484662</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;Thks for that, I&amp;#39;ll be implementing some kind of role based security in my project soon and I wanted to look at your example with more detail to decide how to do it.&lt;/p&gt;&lt;p&gt;One thing I noticed is the use of IAutoFieldGenerator to display/hide fields depending on the Permissions. Well, in my case I had to set the autoGenerateRows/Columns to false and manually add &amp;lt;asp:DynamicDataField&amp;gt; because I wanted to change the order in which fields appear and also don&amp;#39;t show some of them in Insert or Edit mode (auto-filled values, for example).&lt;/p&gt;&lt;p&gt;The question is if there&amp;#39;s some way I can do this whole &amp;quot;security using roles&amp;quot; thing in the way I have it set up (with rows/columns not generated automatically) and without doing it all manually, like:&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;span class="kwd"&gt;protected void&lt;/span&gt; GridView1_RowDataBound(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, GridViewRowEventArgs e)
        {
            &lt;span class="kwd"&gt;if&lt;/span&gt; (e.Row.RowType == DataControlRowType.DataRow)
            {
                &lt;span class="kwd"&gt;if&lt;/span&gt; (!Roles.IsUserInRole(&lt;span class="st"&gt;&amp;quot;Administrator&amp;quot;&lt;/span&gt;))
                {
                    LinkButton deleteLink = e.Row.FindControl(&lt;span class="st"&gt;&amp;quot;DeleteLinkButton&amp;quot;&lt;/span&gt;) &lt;span class="kwd"&gt;as&lt;/span&gt; LinkButton;
                    deleteLink.Visible = &lt;span class="kwd"&gt;false&lt;/span&gt;;
                }
            }

        }&lt;/pre&gt;&lt;p&gt;And how can I hide a DynamicDataField programatically based on roles?&lt;/p&gt;&lt;p&gt;Thks in advance. &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: A DynamicData Attribute Based Permission Solution using User Roles</title><link>http://forums.asp.net/thread/2478139.aspx</link><pubDate>Wed, 09 Jul 2008 18:11:58 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2478139</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2478139.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2478139</wfw:commentRss><description>&lt;p&gt;Sorry about that I don&amp;#39;t know what happend there but I&amp;#39;ve fixed it, it&amp;#39;s &lt;a href="http://csharpbits.notaclue.net/2008/05/dynamicdata-generate-columnsrows-using.html"&gt;&lt;font color="#5403fa"&gt;here&lt;/font&gt;&lt;/a&gt;. Also there is the database based permissions &lt;a href="http://csharpbits.notaclue.net/2008/06/dynamicdata-database-based-permissions_28.html"&gt;DynamicData: Database Based Permissions - Part 5&lt;/a&gt;&amp;nbsp;which has all the downloads and links to the other articles in the series. &lt;img src="http://forums.asp.net/emoticons/emotion-2.gif" alt="Big Smile" /&gt;&lt;/p&gt;</description></item><item><title>Re: A DynamicData Attribute Based Permission Solution using User Roles</title><link>http://forums.asp.net/thread/2478085.aspx</link><pubDate>Wed, 09 Jul 2008 17:52:29 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2478085</guid><dc:creator>asrfarinha</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2478085.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2478085</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;There seems to be a problem with the download. It should be &lt;a href="http://csharpbits.notaclue.net/2008/05/dynamicdata-generate-columnsrows-using.html"&gt;here&lt;/a&gt;, right? But the link is nort working.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: A DynamicData Attribute Based Permission Solution using User Roles</title><link>http://forums.asp.net/thread/2384889.aspx</link><pubDate>Wed, 28 May 2008 08:26:52 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2384889</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2384889.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2384889</wfw:commentRss><description>&lt;p&gt;Thanks David, I&amp;#39;ve just got a few loose ends to tie up, they are&amp;nbsp;there in the download but I just need to&amp;nbsp;post them.&lt;/p&gt;</description></item><item><title>Re: A DynamicData Attribute Based Permission Solution using User Roles</title><link>http://forums.asp.net/thread/2383862.aspx</link><pubDate>Tue, 27 May 2008 19:32:35 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2383862</guid><dc:creator>davidebb</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2383862.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2383862</wfw:commentRss><description>&lt;p&gt;Thanks Steve, this is great!&amp;nbsp; I just wrote a&amp;nbsp;short &lt;a class="" href="http://blogs.msdn.com/davidebb/archive/2008/05/27/sample-dynamic-data-and-attribute-based-permissions.aspx"&gt;post&lt;/a&gt; pointing to it.&lt;/p&gt;
&lt;p&gt;David&lt;/p&gt;</description></item><item><title>A DynamicData Attribute Based Permission Solution using User Roles</title><link>http://forums.asp.net/thread/2381331.aspx</link><pubDate>Mon, 26 May 2008 19:05:06 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2381331</guid><dc:creator>sjnaughton</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2381331.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1145&amp;PostID=2381331</wfw:commentRss><description>&lt;p&gt;I&amp;#39;ve just finished a series of post on &amp;nbsp;&amp;quot;A DynamicData Attribute Based Permission Solution using User Roles&amp;quot; see this &lt;a class="" href="https://forums.asp.net/p/1258077/2346917.aspx#2346917"&gt;thread&lt;/a&gt; for the inspiration.&lt;/p&gt;
&lt;p&gt;Link to my post on &lt;a class="" href="http://csharpbits.notaclue.net/2008/05/dynamicdata-generate-columnsrows-using.html"&gt;A DynamicData Attribute Based Permission Solution using User Roles&lt;/a&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;There is a download of the website at the end of the series all ready to go.&lt;/p&gt;</description></item></channel></rss>