+1-888-365-2779
Try Now
More in this section

Forums / Security / Cant assign users to a role

Cant assign users to a role

2 posts, 0 answered
  1. Abhijit
    Abhijit avatar
    5 posts
    Registered:
    10 Jun 2010
    02 Jul 2010
    Link to this post

    In the Administration Panel under Users, when I add a User from the Active Directory; I get the message "User 'username' has been assigned to 'rolename'" but when I look at the roles the users are not in them. I had been trying to resolve this for a while now but to no avail, please help.

    I am using the CustomRoleProvider.

    Attached is my web.config

    <connectionStrings>
        <add name="IDTADService" connectionString="LDAP://mydomain" />
        <add name="Sitefinity" connectionString="data source=ISW-ACHATTERJEE\SQLEXPRESS;Integrated Security=SSPI;initial catalog=IDT_CMS" providerName="System.Data.SqlClient" />
    </connectionStrings>
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089" />
                <add assembly="System.DirectoryServices, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A" />
            </assemblies>
        </compilation>
        <roleManager enabled="true" cacheRolesInCookie="true" defaultProvider="Sitefinity">
            <providers>
                <clear />
                <add connectionStringName="DefaultConnection" 
                applicationName="/" 
                name="Sitefinity" 
                type="Telerik.DataAccess.AspnetProviders.TelerikRoleProvider, Telerik.DataAccess" />
            </providers>
        </roleManager>
        <membership defaultProvider="Sitefinity">
            <providers>
                <clear />
                <add connectionStringName="IDTADService" 
                enableSearchMethods="true" 
                attributeMapUsername="sAMAccountName" 
                connectionUsername="themonkey" 
                connectionPassword="gotspanked" 
                name="Sitefinity" 
                type="Telerik.Security.ActiveDirectory.TelerikADMembershipProvider, Telerik.Security" />
            </providers>
        </membership>
        <profile defaultProvider="Sitefinity">
            <providers>
                <clear />
                <add name="Sitefinity" connectionStringName="DefaultConnection" applicationName="/" type="Telerik.DataAccess.AspnetProviders.TelerikProfileProvider, Telerik.DataAccess" />
            </providers>
            <properties>
                <add name="FirstName" />
                <add name="LastName" />
                <add name="Position" />
                <add name="Photo_Hidden" />
                <add name="Photo" defaultValue="~/Sitefinity/Common/Images/defaultavatar.gif" />
                <group name="InstantMessenger">
                    <add name="IM_Type" />
                    <add name="IM_Value" />
                </group>
                <group name="Phone">
                    <add name="Value" />
                    <add name="Type" />
                </group>
            </properties>
        </profile>
         
        <security defaultProvider="DefaultSecurityProvider" cmsProvidersName="Sitefinity">
            <roles>
                <clear />
                <add name="Administrators" permission="Unrestricted" />
                <add name="achatterjee" permission="Unrestricted" />
            </roles>
            <providers>
                <clear />
                <add name="DefaultSecurityProvider" connectionStringName="DefaultConnection" type="Telerik.Security.Data.DefaultSecurityProvider, Telerik.Security.Data" membershipProvider="Sitefinity" roleProvider="Sitefinity" />
            </providers>
        </security>
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    04 Jul 2010
    Link to this post
    Hello Abhijit,

    Membership and Role providers are related. Out of the box our providers do not implement logic for maintaining roles and users from AD. By default Sitefinity is just an acceptor of AD users and roles. I believe that the problem is somewhere in the code of your role provider and AddUsersToRoles method which you have to use to adding a user to a role.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
2 posts, 0 answered