mirror of
https://github.com/wekan/wekan.git
synced 2026-11-25 04:49:41 -05:00
33 lines
688 B
JavaScript
33 lines
688 B
JavaScript
import Org from '/models/org';
|
|
|
|
Org.allow({
|
|
async insert(userId, doc) {
|
|
const user = await Meteor.users.findOneAsync(userId);
|
|
if (user?.isAdmin)
|
|
return true;
|
|
if (!user) {
|
|
return false;
|
|
}
|
|
return doc._id === userId;
|
|
},
|
|
async update(userId, doc) {
|
|
const user = await Meteor.users.findOneAsync(userId);
|
|
if (user?.isAdmin)
|
|
return true;
|
|
if (!user) {
|
|
return false;
|
|
}
|
|
return doc._id === userId;
|
|
},
|
|
async remove(userId, doc) {
|
|
const user = await Meteor.users.findOneAsync(userId);
|
|
if (user?.isAdmin)
|
|
return true;
|
|
if (!user) {
|
|
return false;
|
|
}
|
|
return doc._id === userId;
|
|
},
|
|
fetch: [],
|
|
});
|