Exemple #1
0
        public bool IsAdministrator(string token)
        {
            var result = _tokenHandler.VerifyJwtSecurityToken(token);

            if (string.IsNullOrEmpty(result))
            {
                return(false);
            }
            int userTypeId = _userManagement.GetUserTypeByUser(Convert.ToInt32(result));

            if (userTypeId == UserTypes.Admin)
            {
                return(true);
            }
            return(false);
        }