Add Delegation

Topics: General Topic
Apr 15, 2013 at 4:36 PM

Currently, I accede to my roles with :
    <add name="NetSqlAzManRoleProvider" connectionString="Data Source=*****;Initial Catalog=NetSqlAzManStorage;Integrated Security=True" providerName="System.Data.SqlClient"/>
 <roleManager defaultProvider="NetSqlAzManRoleProvider" enabled="true" cacheRolesInCookie="false" cookieName=".ASPROLES" cookieTimeout="30" cookiePath="/" cookieRequireSSL="false" cookieSlidingExpiration="true" cookieProtection="All">
        connectionStringName="NetSqlAzManRoleProvider" storeName="*****" applicationName="****" userLookupType="LDAP" defaultDomain="****" UseWCFCacheService="False" />
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,
Apr 16, 2013 at 5: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)
Apr 18, 2013 at 6: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,

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