Beispiel #1
0
        public async Task <ListResponseModel <SubvaultUserResponseModel> > GetBySubvault(string orgId, string subvaultId)
        {
            // TODO: permission check
            var subvaultUsers = await _subvaultUserRepository.GetManyDetailsBySubvaultIdAsync(new Guid(subvaultId));

            var responses = subvaultUsers.Select(s => new SubvaultUserResponseModel(s));

            return(new ListResponseModel <SubvaultUserResponseModel>(responses));
        }
        public async Task <ListResponseModel <SubvaultUserResponseModel> > GetBySubvault(string orgId, string subvaultId)
        {
            var subvaultIdGuid = new Guid(subvaultId);
            var subvault       = await _subvaultRepository.GetByIdAsync(subvaultIdGuid);

            if (subvault == null || !_currentContext.OrganizationAdmin(subvault.OrganizationId))
            {
                throw new NotFoundException();
            }

            var subvaultUsers = await _subvaultUserRepository.GetManyDetailsBySubvaultIdAsync(subvaultIdGuid);

            var responses = subvaultUsers.Select(s => new SubvaultUserResponseModel(s));

            return(new ListResponseModel <SubvaultUserResponseModel>(responses));
        }