Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • stc 72 posts 101 karma points
    Jan 23, 2010 @ 11:24
    stc
    0

    Membership best practice

    Hey guys,

      first off, so sorry if I'm posting this in a wrong section...but my question is kinda multi-field...though in part is concerned with templating.

      I would like to have a couple of user types on my umbraco website who can view content depending on their type and would like for them all to use a single login page/custom control...how ever...I'm unclear what would be the best practice to do that?

      I have the following idea: I would extend my page content document types with a custom data type that would indicate which user types can view it's content...then I would make a custom control that would check the type of the user requesting the content (anonymous, logged in user, admin...etc.) and then add it in the master template so that in case the user's type is not in the list of those who can view the content...the control would render "access denied, please login" instead of the regular content...or (I haven't decided yet) maybe it would just do the redirect to a login page (I think that would maybe be much simpler/cleaner than having the logic in the macro/template to determine what to render)?

      Is this a good solution, extending document type with user type access rights flags...or are there better best practice soluitions out there please...which please?

      TIA

  • Seth Niemuth 275 posts 397 karma points
    Jan 23, 2010 @ 12:41
    Seth Niemuth
    0

    I think that instead of 'Users' you mean 'Members'. Users are used for the backend (writers, editors, and administrators of content and the rest of the settings), while members are used to control access to certain pages of the live site. 

    (if you actually do mean users, then you need to check out how to set permissions for them and set their start nodes. you set the start node/page for a user in the 'Users' section and you can also set their permissions for pages/nodes in that section as well).

    You should check out members and membership. You can set 'Public Access' in the content area to only allow certain groups that you create in 'Members' access to certain pages. Here is a good blog post on how to do it: http://www.mortenbock.dk/blog/2009/04/01/setting-up-membership-in-umbraco.aspx

  • stc 72 posts 101 karma points
    Jan 24, 2010 @ 19:21
    stc
    0

    Sorry I was unclear...I did mean 'users' and not 'members'...though I'd like to use 'member' umbraco functionality too.

    To straighten everything up, I would like to use an existing AD users for making a custom login to my site...since I'm thinking keeping two user databases would be too cumbersome...I already have a lot of users (thousands) in one database, that database is beeing updated daily, however importing them into umbraco's members is not something i'd like to use as a solution.

    I would much rather use the existing database and query if users should have access to some pages based on the queries to that other database (Active Directory). That said, I'd like to use umbraco members too. Thought my writers/editors would mostly use their Microsoft Word to post their articles and administrators would login to the umbraco backend.

  • Seth Niemuth 275 posts 397 karma points
    Jan 24, 2010 @ 20:14
    Seth Niemuth
    0

    Oh, alright, you will want to create a new membership provider to connect with your existing db/users. Your permissions will still be controlled in umbraco (setting start nodes and using the umbraco permissions for pages).

    Here is an old forum thread on the active directory membership provider and membership providers in general:

    I am guessing that your membership provider will check against either your other database, or active directory, and if they are not an umbraco user, it will create that user with a certain user type depending on what groups they are members of in active directory (here is an api cheatsheet for users: http://umbraco.org/documentation/books/api-cheatsheet/users,-user-types-and-permissions). 
    This article tells you where to change values in the config files for your new membership provider:

Please Sign in or register to post replies

Write your reply to:

Draft