Add Delegation

Topics: General Topic
Apr 15, 2013 at 3:36 PM
Hello,

Currently, I accede to my roles with :
<connectionStrings>
    <add name="NetSqlAzManRoleProvider" connectionString="Data Source=*****;Initial Catalog=NetSqlAzManStorage;Integrated Security=True" providerName="System.Data.SqlClient"/>
  </connectionStrings>
 <roleManager defaultProvider="NetSqlAzManRoleProvider" enabled="true" cacheRolesInCookie="false" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
      <providers>
        <clear/>
        <add
        name="NetSqlAzManRoleProvider"
        type="NetSqlAzMan.Providers.NetSqlAzManRoleProvider"
        connectionStringName="NetSqlAzManRoleProvider" storeName="*****" applicationName="****" userLookupType="LDAP" defaultDomain="****" UseWCFCacheService="False" />
      </providers>
    </roleManager>
Code Behind :
string[] roles = System.Web.Security.Roles.GetRolesForUser();
Fist question :
What is the difference between this code and CheckAccessHelper ???
For me this code is more easy !
CheckAccessHelper is not dynamic (must be regenerated class when adding a role)

Second question :
I would like to add someone to a group.
I don't no when a person have delegate or not ...

Best regards,
Cédric
Coordinator
Apr 16, 2013 at 4:19 PM
I Cédric,

1) The CheckAccessHelper is historically old. it has been preserved for backward compatibility only.

2) Use this
public void AddUsersToRoles(string[] usernames,string[] roleNames)
Regards,
Andrea.
Apr 18, 2013 at 5:15 PM
Thank you Andrea,

I use "NetSqlAzMan Guide.pdf" (framework 3.5) for delegate. Whith the guide it's very easy !!!
  • The CheckAccessHelper is historically old. it has been preserved for backward compatibility only.
    Ok ! I understand !
In my application I know only user's roles.
In your opinion, for V3.6.0.5, what's best access code ?

Currently, I use "cookie" and System.Web.Security.Roles.GetRolesForUser, but I don't know the advantage and disadvantage ?

I want to say, netsqlazman is a great application !!!
Thank you very much.

Best regards,
Cédric

(sorry for my bad english ^^)
Coordinator
Apr 23, 2013 at 9:26 AM
Hi,
Thanks for the compliments...
The NetSqlAzManRoleProvider is the best choice; Cookies are used to cache user roles.
Regards,
Andrea.