Copied to clipboard

Flag this post as spam?

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


  • John Churchley 272 posts 1258 karma points c-trib
    Jan 21, 2019 @ 10:46
    John Churchley
    0

    Get list of member permission groups on MemberService.Saving event

    Hi,

    I need to set a property value depending on what permission group a member is in. Can you get a list of member permission groups on the MemberService.Saving event.

    Unable to use System.Web.Security.Roles.GetRolesForUser as role hasn't been set.

    MemberService.AssignedRoles event seems to fire after Saving event.

    Cheers

    John

  • Ryan Davis 4 posts 96 karma points
    Jan 21, 2019 @ 11:55
    Ryan Davis
    0
    ApplicationContext.Current.Services.MemberService.GetAllRoles()
    

    Is this what you're looking for?

  • John Churchley 272 posts 1258 karma points c-trib
    Jan 21, 2019 @ 12:05
    John Churchley
    0

    Hi Ryan,

    Afraid that method just returns all possible roles for a member.

    I'm trying to get a property after a role is assigned. However the event fires after the saving/saved event which means if someone re-saves after changing the role the update is overwritten.

  • John Churchley 272 posts 1258 karma points c-trib
    Jan 21, 2019 @ 12:06
    John Churchley
    100

    In the end I had to abstract the functions into a separate method and call it against Saving & AssignedRoles events so it wasn't override if someone set a role then resaved afterwards.

Please Sign in or register to post replies

Write your reply to:

Draft