mirror of https://github.com/Squidex/squidex.git
9 changed files with 88 additions and 18 deletions
@ -0,0 +1,22 @@ |
|||
// ==========================================================================
|
|||
// Extensions.cs
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex Group
|
|||
// All rights reserved.
|
|||
// ==========================================================================
|
|||
|
|||
using System.Security.Claims; |
|||
using Squidex.Config; |
|||
using Squidex.Infrastructure.Security; |
|||
|
|||
namespace Squidex.Pipeline |
|||
{ |
|||
public static class Extensions |
|||
{ |
|||
public static bool IsFrontendClient(this ClaimsPrincipal principal) |
|||
{ |
|||
return principal.IsInClient(Constants.FrontendClient); |
|||
} |
|||
} |
|||
} |
|||
@ -0,0 +1,21 @@ |
|||
// ==========================================================================
|
|||
// MustBeAppReaderAttribute.cs
|
|||
// Squidex Headless CMS
|
|||
// ==========================================================================
|
|||
// Copyright (c) Squidex Group
|
|||
// All rights reserved.
|
|||
// ==========================================================================
|
|||
|
|||
using Microsoft.AspNetCore.Authorization; |
|||
using Squidex.Shared.Identity; |
|||
|
|||
namespace Squidex.Pipeline |
|||
{ |
|||
public sealed class MustBeAppReaderAttribute : AuthorizeAttribute |
|||
{ |
|||
public MustBeAppReaderAttribute() |
|||
{ |
|||
Roles = SquidexRoles.AppReader; |
|||
} |
|||
} |
|||
} |
|||
Loading…
Reference in new issue