コード例 #1
0
        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)));
        }
コード例 #2
0
 public async Task <IEnumerable <ListPerson> > GetList()
 {
     return(await _familyRepository.GetList());
 }