protected bool IsActionAllowed(string actionId, string userRoleName) { if (_actionPermissions == null) { _actionPermissions = _actionPermissionRepo.GetActionPermissions(); } var actionPermission = _actionPermissions.Where(w => w.ActionId == actionId && w.ApplicationRoleName == userRoleName).SingleOrDefault(); return(actionPermission != null ? true : false); }