Skip to content

Instantly share code, notes, and snippets.

View gmemstr's full-sized avatar
🏳️‍🌈
Free hugs!

Gabriel Simmer gmemstr

🏳️‍🌈
Free hugs!
View GitHub Profile
@lizconlan
lizconlan / CouchDB security - prevent non-admins from editing
Created July 26, 2010 12:37
CouchDB security - prevent non-admins from editing
function(newDoc, oldDoc, userCtx) {
if (userCtx.roles.indexOf('_admin') !== -1) {
return;
} else {
throw({forbidden: 'Only admins may edit the database'});
}
}