mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 10:48:06 -05:00
13 lines
298 B
JavaScript
13 lines
298 B
JavaScript
import UnsavedEditCollection from '/models/unsavedEdits';
|
|
|
|
function isAuthor(userId, doc, fieldNames = []) {
|
|
return userId === doc.userId && fieldNames.indexOf('userId') === -1;
|
|
}
|
|
|
|
UnsavedEditCollection.allow({
|
|
insert: isAuthor,
|
|
update: isAuthor,
|
|
remove: isAuthor,
|
|
fetch: ['userId'],
|
|
});
|