<?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>Search results matching tag 'Roles'</title><link>http://forums.asp.net/search/SearchResults.aspx?q=&amp;tag=Roles&amp;orTags=0&amp;o=DateDescending</link><description>Search results matching tag 'Roles'</description><dc:language>en-US</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Loginview with Roles in Masterpage</title><link>http://forums.asp.net/thread/3543148.aspx</link><pubDate>Wed, 02 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3543148</guid><dc:creator>aspcheetah</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;&lt;p&gt;I have two questions. I will ask the long one first.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;I have a master page with Loginview control that shows content based on roles. In the roles template of loginview I have defined a template for admin and another for a role called user. The difference between the two is that the admin sees the menu controls (whereas the user does not see the menu controls). Everything else remains the same. In admin I have content placeholder to show content from a specific page. But, in the user template I do not have the same contentplaceholder (id is different). &lt;/p&gt;&lt;p&gt;&lt;br /&gt;Now, since the id of contentplaceholder in user role template is different, I have to give two SAME CONTENT controls in each page that i want to show to both admin and user. I also have to duplicate code behind to deal with this.&lt;/p&gt;&lt;p&gt;Iam sure there must be a more elegant way to accomplish this. Please help. Thanks&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;2) My second question is: when the user logs out, master page (which has css) no longer gets applied and the page becomes unformatted. Why does this happen? ANOTHER POINT TO NOTE HERE: this does not happen when I upload to my remote hosting provider. It only happens when I debug locally.Why????&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks in advance for your help folks.&lt;/p&gt;&lt;p&gt;&lt;br /&gt;Dave&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Loginview with Roles in Masterpage</title><link>http://forums.asp.net/thread/3543267.aspx</link><pubDate>Wed, 02 Dec 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3543267</guid><dc:creator>mehryad</dc:creator><description>&lt;p&gt;If they&amp;#39;re exactly the same templates and the only difference is the menu (which only the admin can see) do the following:&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;asp:LoginView ID=&amp;quot;LoginView1&amp;quot; runat=&amp;quot;server&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;LoggedInTemplate&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;b&gt;Place what both roles have access to here!&lt;/b&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/LoggedInTemplate&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;&amp;lt;RoleGroups&amp;gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;&amp;lt;asp:RoleGroup Roles=&amp;quot;admin&amp;quot;&amp;gt;&lt;/div&gt;
&lt;div style="position:absolute;left:-10000px;top:0px;width:1px;height:1px;overflow-x:hidden;overflow-y:hidden;" id="_mcePaste"&gt;&amp;lt;ContentTemplate&amp;gt;&lt;/div&gt;&lt;p&gt;&lt;p&gt;&amp;lt;RoleGroups&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;asp:RoleGroup Roles=&amp;quot;admin&amp;quot;&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;ContentTemplate&amp;gt;&lt;/p&gt;&lt;/p&gt;&lt;p&gt;&lt;span class="Apple-style-span" style="font-weight:bold;"&gt;Place what only the &amp;quot;admin&amp;quot; can access here&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;p&gt;&amp;lt;/ContentTemplate&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/asp:RoleGroup&amp;gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/RoleGroups&amp;gt;&lt;/p&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;p&gt;&amp;lt;/asp:LoginView&amp;gt;&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;In regards to your second question; not being able to have a look at your code my best guess is that the page that the user is re-directed to when they log out contains the wrong href to the style sheet! check to make sure it&amp;#39;s right!&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Hope this helped you! (P.S. don&amp;#39;t forget to mark as answer if it did)&lt;/p&gt;</description></item><item><title>Display User and associated roles in gridview</title><link>http://forums.asp.net/thread/3501583.aspx</link><pubDate>Mon, 09 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3501583</guid><dc:creator>nosigninname99</dc:creator><description>&lt;p&gt;Hi all,&lt;/p&gt;
&lt;p&gt;I have a system with 3 roles to which&amp;nbsp;a user can be assigned to. What I want to display in the gridview is on one line to have user name and then 3 checkboxes for each role. Ticked if a member of that role.&amp;nbsp;&amp;nbsp;&amp;nbsp;Any ideas?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Problem in Membership provider</title><link>http://forums.asp.net/thread/3501785.aspx</link><pubDate>Mon, 09 Nov 2009 05:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3501785</guid><dc:creator>X-treme</dc:creator><description>&lt;p&gt;Dear All,&lt;/p&gt;&lt;p&gt;I am facing some problem with the asp.net membership provider. I am using createuserwizard for registration. In the wizard i have bound roles. One user can be assigned to multiple roles. If i use single role it works fine but if i assign a user in multiple roles then the problem arises. In the aspnet_users table two rows are inserted and in the aspnet_usersinroles table roles are inserting but the userid is not the actual userid which is created in aspnet_membership table. It takes the second one. The userid doesn&amp;#39;t have the reference in the aspnet_membership table I have tried with the aspnet webadmin files also. But same problem is happening there also. Please help me to solve this bug. If sample code is being posted it will help a lot.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>how to add roles?</title><link>http://forums.asp.net/thread/3479117.aspx</link><pubDate>Tue, 27 Oct 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3479117</guid><dc:creator>jeremyzb</dc:creator><description>&lt;p&gt;Hi all,&lt;br /&gt;&lt;/p&gt;&lt;p&gt;&amp;nbsp;how can I add roles in web.config or in database, then the following codes works.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;[Authorize(Users=&amp;quot;aa&amp;quot;)]&lt;/p&gt;&lt;p&gt;[Authorize(Roles=&amp;quot;admin&amp;quot;)]&lt;/p&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;thanks&lt;br /&gt;&lt;/p&gt;</description></item><item><title>MySQL Asp.net Membership Issues</title><link>http://forums.asp.net/thread/3474108.aspx</link><pubDate>Fri, 23 Oct 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3474108</guid><dc:creator>Nai</dc:creator><description>&lt;p&gt;Hi, I&amp;#39;m using MySQL connector 6.1.2 with my asp.net page for the past couple days trying to get it posted on GoDaddy.com to use membership for my site. I&amp;#39;ve encountered a series of problems in terms of loading the mysql.data.dll and mysql.web.dll and finally I think I finally made a breakthrough today only to be presented with a new error. Can someone help me please? The Exception being issued is:&lt;/p&gt;&lt;table bgcolor="#ffffcc"&gt;

&lt;tr&gt;
&lt;td&gt;&lt;code&gt;
&lt;pre style="font-family:&amp;#39;Lucida Console&amp;#39;;font-size:0.9em;"&gt;[SecurityException: Request for the permission of type &amp;#39;System.Diagnostics.EventLogPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=*********&amp;#39; failed.]
   System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark&amp;amp; stackMark, Boolean isPermSet) +0
   System.Security.CodeAccessPermission.Demand() +58
   System.Diagnostics.EventLog..ctor(String logName, String machineName, String source) +125
   System.Diagnostics.EventLog..ctor() +24
   MySql.Web.Security.MySQLMembershipProvider.WriteToEventLog(Exception e, String action) +30
   MySql.Web.Security.MySQLMembershipProvider.ValidateUser(String username, String password) +864
   System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +60
   System.Web.UI.WebControls.Login.OnAuthenticate(AuthenticateEventArgs e) +119
   System.Web.UI.WebControls.Login.AttemptLogin() +115
   System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +101
   System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +37
   System.Web.UI.WebControls.Button.OnCommand(CommandEventArgs e) +118
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +166
   System.Web.UI.WebControls.Button.System.Web.UI.IPostBackEventHandler.RaisePostBackEvent(String eventArgument) +10
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
   System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +36
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242
   System.Web.UI.Page.ProcessRequest() +80
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49&lt;/pre&gt;
&lt;/code&gt;&lt;/td&gt;
&lt;/tr&gt;

&lt;/table&gt;&lt;p&gt;&lt;br /&gt;&lt;/p&gt;&lt;p&gt;Thanks in advance.&lt;/p&gt;</description></item><item><title>Re: SQL Server Not Found or Not Accesible</title><link>http://forums.asp.net/thread/3459431.aspx</link><pubDate>Thu, 15 Oct 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3459431</guid><dc:creator>G0ggy</dc:creator><description>&lt;p&gt;The majority of suggestions I have already tried.&lt;/p&gt;&lt;p&gt;The only difference between this website, and the one that works, is that this website implements roles and membership.&lt;/p&gt;&lt;p&gt;Here is the settings for those items to see if you guys can spot any errors in them:&lt;/p&gt;&lt;p&gt;&lt;pre name="code" class="xhtml"&gt;&amp;lt;authentication mode=&amp;quot;Forms&amp;quot;&amp;gt;
          &amp;lt;forms name=&amp;quot;MCERTSSampleData&amp;quot;
             defaultUrl=&amp;quot;~/Default.aspx&amp;quot;
             loginUrl=&amp;quot;~/Insecure/Users/Login.aspx&amp;quot; &amp;gt;&amp;lt;/forms&amp;gt;
      &amp;lt;/authentication&amp;gt;

      &amp;lt;membership defaultProvider=&amp;quot;AspNetMembershipProvider&amp;quot;&amp;gt;
          &amp;lt;providers&amp;gt;
              &amp;lt;add connectionStringName=&amp;quot;ASPMembershipConnString&amp;quot;
                enablePasswordRetrieval=&amp;quot;false&amp;quot; 
                enablePasswordReset=&amp;quot;true&amp;quot;
                requiresQuestionAndAnswer=&amp;quot;false&amp;quot;
                applicationName=&amp;quot;MCERTSSampleData&amp;quot;
                requiresUniqueEmail=&amp;quot;false&amp;quot;
                passwordFormat=&amp;quot;Hashed&amp;quot;
                maxInvalidPasswordAttempts=&amp;quot;5&amp;quot;
                minRequiredPasswordLength=&amp;quot;5&amp;quot;
                minRequiredNonalphanumericCharacters=&amp;quot;0&amp;quot;
                passwordAttemptWindow=&amp;quot;10&amp;quot;
                passwordStrengthRegularExpression=&amp;quot;&amp;quot; 
                name=&amp;quot;AspNetMembershipProvider&amp;quot;
                type=&amp;quot;System.Web.Security.SqlMembershipProvider&amp;quot; /&amp;gt;
          &amp;lt;/providers&amp;gt;
      &amp;lt;/membership&amp;gt;

      &amp;lt;roleManager defaultProvider=&amp;quot;AspNetSqlRoleProvider&amp;quot;
          enabled=&amp;quot;true&amp;quot;
          cacheRolesInCookie=&amp;quot;false&amp;quot;
          cookieName=&amp;quot;.ASPROLES&amp;quot;
          cookieTimeout=&amp;quot;30&amp;quot;
          cookiePath=&amp;quot;/&amp;quot;
          cookieRequireSSL=&amp;quot;false&amp;quot;
          cookieSlidingExpiration=&amp;quot;true&amp;quot;
          cookieProtection=&amp;quot;All&amp;quot; &amp;gt;
              &amp;lt;providers&amp;gt;
                  &amp;lt;add
                    name=&amp;quot;SqlProvider&amp;quot;
                    type=&amp;quot;System.Web.Security.SqlRoleProvider&amp;quot;
                    connectionStringName=&amp;quot;ASPMembershipConnString&amp;quot;
                    applicationName=&amp;quot;MCERTSSampleData&amp;quot; /&amp;gt;
              &amp;lt;/providers&amp;gt;
      &amp;lt;/roleManager&amp;gt;&lt;/pre&gt;&lt;br /&gt; &lt;br /&gt;&lt;/p&gt;</description></item><item><title>LoginView and Gridviews (User Control based on role)</title><link>http://forums.asp.net/thread/3408082.aspx</link><pubDate>Wed, 16 Sep 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3408082</guid><dc:creator>Yanayaya</dc:creator><description>&lt;p&gt;&amp;nbsp;I am making an intranet page and I have been working with 2 ideas and I cannot decide on which would be best and / or standard practice.&lt;/p&gt;
&lt;p&gt;On one hand I can protect my pages with roles and users. Simple enough.&amp;nbsp; But would it be common place to use a loginview to control weather a user can edit user data? Or would it be more practical to use the roles to define what the user can and cannot not.&lt;/p&gt;
&lt;p&gt;I have data being displayed in a detail view, and want an anon user to simply be able to view the data and a logged in user to be able to edit it. So I used the login view, with the anon templaye showing the data one way and the logged in template showing it with edit and delete controls.&amp;nbsp; However this means that a user who simply logs in can use thos controls and there is no delegation of rights.&lt;/p&gt;
&lt;p&gt;So it doesnt feel like I am using it the way I should or is it ok to use the loginview in this fashion?&lt;/p&gt;
&lt;p&gt;If I want to allow certain users the ability to edit database infromation from these gridviews and details views using roles. What is the best way to accomplish this?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thanks in advance&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;yan&lt;/p&gt;</description></item><item><title>Re: Authentication in MVC</title><link>http://forums.asp.net/thread/3387356.aspx</link><pubDate>Fri, 04 Sep 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3387356</guid><dc:creator>sjnaughton</dc:creator><description>&lt;p&gt;[quote user=&amp;quot;joaoluizbt&amp;quot;][AcceptVerbs(HttpVerbs.Post), Authorize][/quote]&amp;nbsp;&lt;/p&gt;
&lt;p&gt;see &lt;a href="http://forums.asp.net/Part9.htm"&gt;How to secure applications using authentication and authorization&lt;/a&gt;&amp;nbsp;from the NerdDinner tutorial.&lt;/p&gt;
&lt;p&gt;Your above code only says that users MUST be authenticated to access this controller, if you wanted only certan users to have access then you could use Roles like this:&lt;/p&gt;&lt;pre class="c-sharp" name="code"&gt;[AcceptVerbs(HttpVerbs.Post), Authorize(Roles=&amp;quot;Admin,Accounts&amp;quot;)]&lt;/pre&gt;
&lt;p&gt;&lt;br /&gt;This would then only allow members of the &amp;quot;Admin&amp;quot; and &amp;quot;Accouns&amp;quot; roles to access the controller.&lt;/p&gt;</description></item><item><title>users, roles linking to specific table</title><link>http://forums.asp.net/thread/3298109.aspx</link><pubDate>Thu, 16 Jul 2009 04:00:00 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:3298109</guid><dc:creator>tnichols333</dc:creator><description>&lt;p&gt;Basically - I am new to security and need a little help.&amp;nbsp; This is probably simple and there may be examples out there - but I can&amp;#39;t find anything (probably don&amp;#39;t know the right thing to look for).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I am writing a asp.net web application in vb.net (CRM) where sales people log in and should only be able to see their accounts, even on reports or anything else...&amp;nbsp;&amp;nbsp; I will probably just use the built in membership and roles of 3.5 if possible, but not opposed to doing something custom if needed.&lt;/p&gt;
&lt;p&gt;any example or help would be much appreciated!!!&lt;/p&gt;</description></item></channel></rss>