Copied to clipboard

Flag this post as spam?

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


  • Dr. Sugus 26 posts 101 karma points
    Jun 08, 2014 @ 23:24
    Dr. Sugus
    0

    Assigning member groups (roles) to current identity

    Hi Umbracoes

    I have a site with forms authentication and a substantial amount of users in a relational, non-Umbraco database.

    I would like to be able to set permissions for member groups using the Umbraco GUI, but without having Umbraco load the users into the Members section, given the amount of users and the lacking necessity in my case.

    I tried calling Roles.AddUserToRole("[userId]", "name of Umbraco member group"), but Umbraco wants the user id to match an Umbraco member. Does anyone know what I can override to prevent that from happening? I just need HttpContext.Current.User to be member of a role, while the user exists.

    In another CMS, this is commonly solved by calling Roles.AddUserToRole with the id of a virtual user (the user-role relationship disappears when the session ends) - I was hoping for a similar one-line-instant-gratification method here, but can't find one.

    I've seen a lot about custom membership providers, but I still don't see a way to attach a "volatile" (current) user to a role. It looks like I have to let Umbraco know about every single user I have, so the user-role membership can be persisted.

    Am I missing something?

    Have a happy super sunday and thanks for reading this long post :)

  • Dr. Sugus 26 posts 101 karma points
    Nov 12, 2014 @ 09:15
    Dr. Sugus
    100

    It doesn't look like one can have virtual users/members in Umbraco; one has to persist all users that need to be able to log in.

Please Sign in or register to post replies

Write your reply to:

Draft