Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Separate admin setup user from orchardcore.users feature. #16817

Closed
giannik opened this issue Oct 2, 2024 · 2 comments
Closed

Separate admin setup user from orchardcore.users feature. #16817

giannik opened this issue Oct 2, 2024 · 2 comments

Comments

@giannik
Copy link
Contributor

giannik commented Oct 2, 2024

I want to create a custom setup recipe to install my own version of admin user and not use the default provided by Orchardcore.users Feature.
But this is not possible because the admin user Setup event handler is tied to the users feature.
I want to opt-out from the admin user setup when enabling the Users feature.

So i think we should place this in a separate feature . For the built in setup recipes just include this new feature to not break anything.

@MikeAlhayek
Copy link
Member

MikeAlhayek commented Oct 2, 2024

Just remove it from the IoC in a feature that depends on OrchardCore.Users with something like this

var oldProvider = services.FirstOrDefault(x => x.ServiceType == typeof(ISetupEventHandler) && x.GetImplementationType() == typeof(SetupEventHandler));

if (oldProvider is not null)
{
    services.Remove(oldProvider);
}

I don't think we need to create a new feature for this unless you have a better reason for this new feature that can't be achieved with the above approach.

@giannik
Copy link
Contributor Author

giannik commented Oct 3, 2024

that works for me. closing pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants