Skip to content

Commit

Permalink
Fix.
Browse files Browse the repository at this point in the history
  • Loading branch information
Psichorex committed Jan 30, 2024
1 parent ca914d8 commit 8e2511d
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,17 @@ namespace Lombiq.HelpfulExtensions.Extensions.Security.Services;
[RequireFeatures(FeatureIds.Security)]
public class StrictSecurityPermissionAuthorizationHandler : AuthorizationHandler<PermissionRequirement>
{
private readonly IContentDefinitionManager _contentDefinitionManager;

public StrictSecurityPermissionAuthorizationHandler(IContentDefinitionManager contentDefinitionManager) =>
_contentDefinitionManager = contentDefinitionManager;

private static readonly Dictionary<string, IList<string>> _permissionTemplates = ContentTypePermissionsHelper
.PermissionTemplates
.ToDictionary(
pair => pair.Key,
pair => GetPermissionTemplates(pair.Value, new List<string>()));

private readonly IContentDefinitionManager _contentDefinitionManager;

public StrictSecurityPermissionAuthorizationHandler(IContentDefinitionManager contentDefinitionManager) =>
_contentDefinitionManager = contentDefinitionManager;

protected override async Task HandleRequirementAsync(AuthorizationHandlerContext context, PermissionRequirement requirement)
{
if ((context.Resource as IContent)?.ContentItem is not { } contentItem ||
Expand Down

0 comments on commit 8e2511d

Please sign in to comment.