public SingleResult<Person> Get([FromODataUri] int key)
    {
      // if you need a claim for authorization, put that in the MyWebAppAuthorization class

      // if you need a claim to filter data, access it from the ClaimsPrincipal
      var cp = (ClaimsPrincipal)User;
      var odysseyUserId = OdysseySecurity.GetUserIdForUserName(WebConfigHelper.SiteId, cp.GetClaim("http://tylertechnologies.com/2013/claims/odyssey/odysseyusername"));
      var rights = OdysseyUserRights.CheckUserRights(WebConfigHelper.SiteId, odysseyUserId);

      var excludedFields = GetExcludedFields(rights);

      ISearchResponse<Person> result = GetPerson(ElasticSearchHelper.ConstructDefaultIndexSearchObject(), key, excludedFields);
      
      Person person = result.Hits.First().Source;

      // Resolve intents for address
      var mc = new ManifestContext();
      var intents = mc.CreateResolver()
        .FilterByActions("View")
        .FilterByMimeType("Map")
        .WithData(new Dictionary<string, string> {
          { "urlEncodedAddress", formatAddress(person.addressLine1, person.addressLine2, person.addressLine3) }
        })
        .Resolve();

      person.intents = intents.ToList<Intent>();

      // Create a list of type "Person" containing the requested person to the client
      List <Person> list = new List<Person>() { person };
            
      return SingleResult.Create(list.AsQueryable());
    }
Пример #2
0
 public SQLiteMBFileRepository(ManifestContext dbContext)
 {
     DbContext = dbContext;
 }