Skip to content

Commit

Permalink
Use AddPermissionProvider & AddNavigationProvider in OpenID
Browse files Browse the repository at this point in the history
  • Loading branch information
hishamco committed Nov 6, 2024
1 parent 49b2431 commit 8c45681
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/OrchardCore.Modules/OrchardCore.OpenId/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
using OrchardCore.OpenId.Settings;
using OrchardCore.OpenId.Tasks;
using OrchardCore.Recipes;
using OrchardCore.Recipes.Services;
using OrchardCore.Security;
using OrchardCore.Security.Permissions;
using OrchardCore.Settings;
Expand All @@ -52,12 +51,8 @@ public override void ConfigureServices(IServiceCollection services)
.UseYesSql();
});

// Note: the following services are registered using TryAddEnumerable to prevent duplicate registrations.
services.TryAddEnumerable(new[]
{
ServiceDescriptor.Scoped<IPermissionProvider, Permissions>(),
ServiceDescriptor.Scoped<INavigationProvider, AdminMenu>(),
});
services.AddPermissionProvider<Permissions>();
services.AddNavigationProvider<AdminMenu>();
}
}

Expand Down

0 comments on commit 8c45681

Please sign in to comment.