"members": {"names":[""+name+"", "admin"],"roles":[]}
};
fetch('
http://localhost:5984/'+name+'/_security', {
method: 'PUT',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Basic ' + btoa(admin_name + ":" + admin_password),
},
body: JSON.stringify(data),
})
.then(response => response.json())
.then(data => {
console.log('Success:', data);
})
.catch((error) => {
console.error('Error:', error);
});