public async Task <ActionResult <IEnumerable <ListPerson> > > GetList([FromHeader] string authorization) { if (string.IsNullOrEmpty(authorization)) { return(Unauthorized()); } var auth = FirebaseAuth.DefaultInstance; var firebaseToken = await auth.VerifyIdTokenAsync(authorization); var securityLevel = Roles.General; if (firebaseToken.Claims.ContainsKey("edit") && (bool)firebaseToken.Claims["edit"]) { securityLevel = Roles.Admin; } return(Ok(await _familyRepository.GetList(securityLevel))); }
public async Task <IEnumerable <ListPerson> > GetList() { return(await _familyRepository.GetList()); }