Copied to clipboard

Flag this post as spam?

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


  • Tomasz Kowalski 135 posts 445 karma points
    Jan 30, 2014 @ 14:31
    Tomasz Kowalski
    0

    Retreive user rights to webshops

    Hi,

    Umbraco 6.1.6, TC 2.2.2.

    I'm working on multishop website. I can assign rights to specific webshops to specific users, so they can only see "their" shops in backend after log in.

    Can I retreive this "rights" (shops IDs) in front end based on fx. user ID in Razor?

    Yes, I can see, that these information are stored in TeaCommerce_Permission table, but maybe there is something ready?

    Kind regards

    Thomas

  • Anders Burla 2560 posts 8256 karma points
    Jan 31, 2014 @ 09:51
    Anders Burla
    0

    Hi Thomas

    We don't have an API method to give the store id's that a logged in umbraco user has access to. An Umbraco user is not the same as a member. So how are you using the Umbraco users in the front end of your website?

    You can loop all stores using the StoreService.Instance and then use the PermissionService (in infrasturcture/Security) to get the permissions and use HasPermission

    Kind regards
    Anders

  • Tomasz Kowalski 135 posts 445 karma points
    Feb 12, 2014 @ 14:41
    Tomasz Kowalski
    0

    Hi Anders,

    The thing is, that "system" will be open only for salesmen, which also have to had access to TeaCommerce backend. But this is not a problem any longer.

    Thank you for reply anyway

    Kind regards
    Thomas

  • Rune Grønkjær 1371 posts 3102 karma points
    Feb 13, 2014 @ 10:30
    Rune Grønkjær
    0

    Cool. Feel free to suggest us any new features that might have made your life easier in your situation!

    /Rune

  • Tomasz Kowalski 135 posts 445 karma points
    Feb 13, 2014 @ 11:07
    Tomasz Kowalski
    1

    There is no new features. I have used umbraco login and - on frontend - I'm checking logged user this way:

    var currentUser = umbraco.BusinessLogic.User.GetCurrent();

    and retreiving webshops IDs direct from database:

    select * from [dbo].[TeaCommerce_Permission] where not [StoreId] is null and [UserId] = " + currentUser.Id

    /Thomas

Please Sign in or register to post replies

Write your reply to:

Draft