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

Forums / Security / Custom Roles

Custom Roles

8 posts, 0 answered
  1. Allan
    Allan avatar
    4 posts
    Registered:
    10 Jun 2009
    10 Jun 2009
    Link to this post
    I would like to develop a Sitefinity 3.x project with the following constraints:

    1) There are 4 roles: Admin who has access to everything, content creators who have read and write access to certain pages but not all, Partners who have read access to some pages and employees who have read access to all pages.

    2) Ideally, I would like to determine role from custom code which access the corporate internal user directory.  This may mean any combination of custom identity, Principal, role and membership providers.  If at all possible, I would not prefer to store user info in the database for maintenance reasons.  I understand that this may be an issue because of the stateless nature of HTTP.

     Please advise on the best way to proceed.

    Thank you,

    Allan Rosner
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    10 Jun 2009
    Link to this post
    Hello Allan,

    You can achieve your requirement creating these 4 roles through Sitefinity interface. You can assign permissions to each of your role for all pages, for certain pages or for the owner of the page. So that you can decide whether a role will have full or parital access.
    We use ASP.NET Membership providers. You can use System.Web.Security namespace  that contains classes used to implement ASP.NET security in Web server applications or Telerik.Security namespace.

    Sincerely yours,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  3. Allan
    Allan avatar
    4 posts
    Registered:
    10 Jun 2009
    11 Jun 2009
    Link to this post
    Ivan,

    Thank you for the reply.  Do I need to use a custom membership provider?  Do you have any examples of how I would change web.config and develop the membership provider?  Would I build a custom login control? 

    Thanks,

    Al
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 Jun 2009
    Link to this post
    Hi Allan,

    You can use custom membership provider if you you need to store membership information in a data source that is not supported by our provider or you have external source with users data. To add a new membership provider you need to modify <providers> section of web.config's <membership> node

     <membership defaultProvider="Sitefinity" userIsOnlineTimeWindow="15" hashAlgorithmType=""
          <providers> 
            <clear/> 
            <add name="Sitefinity" connectionStringName="DefaultConnection" type="Telerik.DataAccess.AspnetProviders.TelerikMembershipProvider, Telerik.DataAccess" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"/> 
            <add name="Custom" connectionStringName="CustomConnection" type="Telerik.DataAccess.AspnetProviders.TelerikMembershipProvider, Telerik.DataAccess" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" applicationName="/" requiresUniqueEmail="false" passwordFormat="Hashed" maxInvalidPasswordAttempts="5" passwordAttemptWindow="10" passwordStrengthRegularExpression="" minRequiredPasswordLength="1" minRequiredNonalphanumericCharacters="0"/> 
          </providers> 
        </membership> 

    In your case I do not think that you need custom provider.

    All the best,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  5. Allan
    Allan avatar
    4 posts
    Registered:
    10 Jun 2009
    11 Jun 2009
    Link to this post
    Ivan,

    Thank you again.  What are the steps I need to take to develop the application mentioned above?  You say that I do not need a custom Membership provider. Which provider should I use?  Can you give a code example?

    Thank you,

    Allan Rosner
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    11 Jun 2009
    Link to this post
    Hello Allan,

    You can take a look at our UserManual >> Permissions section. Check out the following links as well.

    MSDN Introduction to membership
    Sitefinity Security overview

    Kind regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
  7. Allan
    Allan avatar
    4 posts
    Registered:
    10 Jun 2009
    11 Jun 2009
    Link to this post
    Ivan,

    It seems like I would need custom membership since I need to access 2 different data stores for authenticating users.  Correct?  Do all users need to be stored in a Custom DB or once they are authenticated, the role credentials are cached in memory somewhere?

    Thank you,

    Allan Rosner
  8. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    25 Nov 2016
    12 Jun 2009
    Link to this post
    Hi Allan,

    The users you have should be stored in your data source, from where they will be used.

    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
8 posts, 0 answered