using Hcs.WebApp.Data.Identity;
using System.Security.Claims;

namespace Hcs.WebApp.Utils
{
    public static class ClaimsPrincipalExtensions
    {
        public static bool IsAdministrator(this ClaimsPrincipal claimsPrincipal)
        {
            return claimsPrincipal.IsInRole(AppRole.ADMINISTRATOR_TYPE);
        }

        public static bool IsOperatorOrHigher(this ClaimsPrincipal claimsPrincipal)
        {
            return claimsPrincipal.IsInRole(AppRole.OPERATOR_TYPE) || claimsPrincipal.IsInRole(AppRole.ADMINISTRATOR_TYPE);
        }
    }
}
