Files
wekan/server/permissions/team.js
T

33 lines
691 B
JavaScript

import Team from '/models/team';
Team.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: [],
});