From 34793a35e1c3b54a6da041fdee8960614a4d7c4f Mon Sep 17 00:00:00 2001 From: Rick Falkvinge Date: Mon, 24 Feb 2014 16:18:34 +0000 Subject: [PATCH] updating a security thing --- Site5/Automation/Json-GetPersonAvatar.aspx.cs | 2 +- Site5/Automation/Json-SearchPeoplePattern.aspx.cs | 6 +++--- Site5/Controls/v5/Swarm/ComboPeople.ascx | 5 ++--- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/Site5/Automation/Json-GetPersonAvatar.aspx.cs b/Site5/Automation/Json-GetPersonAvatar.aspx.cs index 50761b3e..3970d3e3 100644 --- a/Site5/Automation/Json-GetPersonAvatar.aspx.cs +++ b/Site5/Automation/Json-GetPersonAvatar.aspx.cs @@ -20,7 +20,7 @@ namespace Swarmops.Frontend.Automation People matches = People.FromSingle(Person.FromIdentity(Int32.Parse(personId))); - matches = Authorization.FilterPeopleToMatchAuthority(matches, CurrentUser.GetAuthority()); + matches = matches.GetVisiblePeopleByAuthority(CurrentUser.GetAuthority()); if (matches.Count == 1) // still allowed { diff --git a/Site5/Automation/Json-SearchPeoplePattern.aspx.cs b/Site5/Automation/Json-SearchPeoplePattern.aspx.cs index ac5cc2e8..e7dd0c75 100644 --- a/Site5/Automation/Json-SearchPeoplePattern.aspx.cs +++ b/Site5/Automation/Json-SearchPeoplePattern.aspx.cs @@ -21,11 +21,11 @@ namespace Swarmops.Frontend.Automation People matches = People.FromNamePattern(pattern); - matches = Authorization.FilterPeopleToMatchAuthority(matches, CurrentUser.GetAuthority()); + matches = matches.GetVisiblePeopleByAuthority(CurrentUser.GetAuthority()); - if (matches.Count > 20) + if (matches.Count > 10) { - matches.RemoveRange(20, matches.Count - 20); + matches.RemoveRange(10, matches.Count - 10); } List jsonPeople = new List(); diff --git a/Site5/Controls/v5/Swarm/ComboPeople.ascx b/Site5/Controls/v5/Swarm/ComboPeople.ascx index 59eb89a3..ab4957a4 100644 --- a/Site5/Controls/v5/Swarm/ComboPeople.ascx +++ b/Site5/Controls/v5/Swarm/ComboPeople.ascx @@ -60,8 +60,8 @@ var autoCompleteLoader = function(param,success,error){ var q = param.q || ''; - if (q.length <= 3) { - return false; + if (q.length < 3) { + success (null); } $.ajax({ url: '/Automation/Json-SearchPeoplePattern.aspx', @@ -71,7 +71,6 @@ namePattern: q }, success: function(data){ - console.log(data); success(data); }, error: function(){