AI OnAI Off
Hi Sujit
I'm not 100% sure what's the challenge you're facing in CMS 12. It would be good to have some pseduo code to describe how you implement the callback in CMS 11
In CMS 12, UIRoleProvider abstract class is still there, you can implement you custom UIRoleProvider and override "CreateRoleAsync" method to intercept anything you would like to perform.
Hi Vincent,
Here is how we used to register a callback using OWIN. Hope this helps.
public static IAppBuilder RegisterCustomRoleProvider(this IAppBuilder app)
{
//CustomIdentityRoleProvider is an implementation of class ApplicationRoleProvider<TUser> where TUser : IdentityUser, IUIUser
//CommerceIdentityUser is an implementation of class IdentityUser & IUIUser
app.CreatePerOwinContext<UIRoleProvider>((o, context) =>
new CustomIdentityRoleProvider<CommerceIdentityUser>(
context.Get<ApplicationUserManager<CommerceIdentityUser>>, context.Get<ApplicationRoleManager<CommerceIdentityUser>>));
return app;
}
Found the fix in just one line.
services.AddTransient<UIRoleProvider, CustomIdentityRoleProvider<CommerceIdentityUser>>();
Hello,
Has anyone implemented a solution for registering a callback if and when we create role in CMS Access Groups (UIRoleProvider) ?
In CMS 11, we used to register using Owin CreatePerOwinContext<UIRoleProvider> But I could not figure out a way to implement the same on CMS 12.
Any help would be appreaciated.
~ Sujit