< Summary

Information
Class: Elsa.Identity.Providers.AdminRoleProvider
Assembly: Elsa.Identity
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/Providers/AdminRoleProvider.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 7
Coverable lines: 7
Total lines: 24
Line coverage: 0%
Branch coverage
N/A
Covered branches: 0
Total branches: 0
Branch coverage: N/A
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
FindManyAsync(...)100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Identity/Providers/AdminRoleProvider.cs

#LineLine coverage
 1using Elsa.Identity.Contracts;
 2using Elsa.Identity.Entities;
 3using Elsa.Identity.Models;
 4
 5namespace Elsa.Identity.Providers;
 6
 7/// <summary>
 8/// Represents a role provider that always returns a single admin role. This is useful for development purposes.
 9/// </summary>
 10public class AdminRoleProvider : IRoleProvider
 11{
 12    /// <inheritdoc />
 13    public ValueTask<IEnumerable<Role>> FindManyAsync(RoleFilter filter, CancellationToken cancellationToken = default)
 14    {
 015        var adminRole = new Role
 016        {
 017            Id = "admin",
 018            Name = "admin",
 019            Permissions = { "*" }
 020        };
 21
 022        return new(new[] { adminRole });
 23    }
 24}