Exemple #1
0
        public async Task <ActionResult <PersonDetails> > Get(int id, [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;
            }

            var returnValues = await _familyRepository.GetDetails(securityLevel, id);

            return(Ok(returnValues));
        }
Exemple #2
0
        public async Task <PersonDetails> Get(int id)
        {
            var returnValues = await _familyRepository.GetDetails(id);

            return(returnValues);
        }