< Summary

Information
Class: Elsa.Labels.Permissions.LabelPermissionsDescriptorProvider
Assembly: Elsa.Labels
File(s): /home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Labels/Permissions/LabelPermissions.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 4
Coverable lines: 4
Total lines: 30
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
GetDescriptors()100%210%

File(s)

/home/runner/work/elsa-core/elsa-core/src/modules/Elsa.Labels/Permissions/LabelPermissions.cs

#LineLine coverage
 1using Elsa.Authorization;
 2using Elsa.Permissions;
 3using JetBrains.Annotations;
 4
 5namespace Elsa.Labels.Permissions;
 6
 7/// <summary>
 8/// Stable resource names for Labels. Endpoints reference these constants rather than string
 9/// literals, and the descriptors below are declared alongside them so the two cannot drift.
 10/// </summary>
 11public static class LabelPermissions
 12{
 13    /// <summary>Manage labels.</summary>
 14    public const string Labels = "labels";
 15
 16    /// <summary>View and change the labels applied to a workflow definition.</summary>
 17    public const string WorkflowDefinitionLabels = "workflows/definitions/labels";
 18}
 19
 20/// <summary>Contributes the Labels resources to the permission catalog.</summary>
 21[UsedImplicitly]
 22public sealed class LabelPermissionsDescriptorProvider : IPermissionDescriptorProvider
 23{
 24    /// <inheritdoc />
 25    public IEnumerable<PermissionDescriptor> GetDescriptors() =>
 026    [
 027        new(LabelPermissions.Labels, [CoreVerbs.View, CoreVerbs.Create, CoreVerbs.Update, CoreVerbs.Delete], "Labels", "
 028        new(LabelPermissions.WorkflowDefinitionLabels, [CoreVerbs.View, CoreVerbs.Update], "Workflow definition labels",
 029    ];
 30}

Methods/Properties

GetDescriptors()