using System.Security.Claims; namespace Infrastructure.Extensions { public static class ClaimsPrincipalExtensions { public static bool IsInRole(this ClaimsPrincipal user, object role) { if (user is null) { throw new System.ArgumentNullException(nameof(user)); } return role == null ? false : user.IsInRole(role.ToString()); } } }