public IEnumerable<MemberGroupDisplay> GetAllGroups()
{
if (_provider.IsUmbracoMembershipProvider())
{
return Services.MemberGroupService.GetAll()
.Select(Mapper.Map<IMemberGroup, MemberGroupDisplay>);
}
return Enumerable.Empty<MemberGroupDisplay>();
}
Where IsUmbracoMembershipProvider checks wether your custom provider is "UmbracoMembershipProviderBase".
And since my custom membership provider was just inheriting "MembershipProvider", it didn't work.
So inheriting UmbracoMembershipProviderBase instead, made everything work as expected.
From your post I understand that I need to create a class that inherits IMemberGroupService and then create a composer to register the class.
However, I already have a role provider defined in our class library. It inherits from System.Web.Security.RoleProvider. This is useless in v8+?
Also can you explain what you meant by the line
So inheriting UmbracoMembershipProviderBase instead, made everything work as expected.
As we have a custom membership provider already defined and used by other non umbraco projects.
This is a very long time ago, so things might have changed and i can't really remember the exact issue.
But from what i can read here, it looks like i basically found that custom membership providers needed to inherit from "UmbracoMembershipProviderBase" instead of just "MembershipProvider".
What version of Umbraco are you using now? Any idea if the iisue persists in the newer version. If they dont have this issue in version 9 then I might upgrade to that version instead.
Custom MemberGroupService only working under "Members" but not in "Public access"
I've implemented my owm membership/role provider and also my own IMemberGroupService by registering it in a composer like so:
And a my test implementation of that service:
Now when i go to "Members -> Member Groups" i see my "DE Medlem" group just fine.
But when i go to set "Public access" on content and choose to set "Group based", i get:
Also the response from /umbraco/backoffice/UmbracoApi/MemberGroup/GetAllGroups looks a bit funny, but might be unrelated.
Any ideas?
After a bit of searching in source, i found that Umbraco does the following before returning groups: https://github.com/umbraco/Umbraco-CMS/blob/1eb0c93e053781cc48f801a878dee3609d92bc71/src/Umbraco.Web/Editors/MemberGroupController.cs#L121
Where IsUmbracoMembershipProvider checks wether your custom provider is "UmbracoMembershipProviderBase". And since my custom membership provider was just inheriting "MembershipProvider", it didn't work.
So inheriting UmbracoMembershipProviderBase instead, made everything work as expected.
Hi Chris,
I am upgrading from v7 to v8 and was stuck in custom role provider configuration. I came across this post while googling about the issue.
Old way of just having a proper role provider in web.config no longer works?
From your post I understand that I need to create a class that inherits IMemberGroupService and then create a composer to register the class. However, I already have a role provider defined in our class library. It inherits from System.Web.Security.RoleProvider. This is useless in v8+?
Also can you explain what you meant by the line
As we have a custom membership provider already defined and used by other non umbraco projects.
Thank you.
Hi Rohan
This is a very long time ago, so things might have changed and i can't really remember the exact issue.
But from what i can read here, it looks like i basically found that custom membership providers needed to inherit from "UmbracoMembershipProviderBase" instead of just "MembershipProvider".
How that might affect role providers im not sure.
Thanks for the response.
What version of Umbraco are you using now? Any idea if the iisue persists in the newer version. If they dont have this issue in version 9 then I might upgrade to that version instead.
is working on a reply...