public object Get(GetUserManage request) { AuthorizationInfo auth_user_info = _ac.GetAuthorizationInfo(Request); UserPolicy policy = _userManager.GetUserPolicy(auth_user_info.User); if (!policy.IsAdministrator) { return(-1); } string action = request.Action; string id = request.Id; if (action == "remove_unknown") { List <string> user_id_list = new List <string>(); foreach (var emby_user in _userManager.Users) { user_id_list.Add(emby_user.Id.ToString("N")); } int removed_count = repository.RemoveUnknownUsers(user_id_list); return(removed_count); } else { repository.ManageUserList(action, id); return(1); } }
public object Get(GetUserManage request) { string action = request.Action; string id = request.Id; if (action == "remove_unknown") { List <string> user_id_list = new List <string>(); foreach (var emby_user in _userManager.Users) { user_id_list.Add(emby_user.Id.ToString("N")); } Repository.RemoveUnknownUsers(user_id_list); } else { Repository.ManageUserList(action, id); } return(true); }