mirror of
https://github.com/wekan/wekan.git
synced 2026-02-21 07:24:07 +01:00
Use sync code in allow/deny for 2.x
This commit is contained in:
parent
f934aea2a5
commit
e77be37450
28 changed files with 594 additions and 410 deletions
|
|
@ -78,8 +78,8 @@ Team.attachSchema(
|
|||
|
||||
if (Meteor.isServer) {
|
||||
Team.allow({
|
||||
async insert(userId, doc) {
|
||||
const user = await ReactiveCache.getUser(userId) || await ReactiveCache.getCurrentUser();
|
||||
insert(userId, doc) {
|
||||
const user = Meteor.users.findOne(userId);
|
||||
if (user?.isAdmin)
|
||||
return true;
|
||||
if (!user) {
|
||||
|
|
@ -87,8 +87,8 @@ if (Meteor.isServer) {
|
|||
}
|
||||
return doc._id === userId;
|
||||
},
|
||||
async update(userId, doc) {
|
||||
const user = await ReactiveCache.getUser(userId) || await ReactiveCache.getCurrentUser();
|
||||
update(userId, doc) {
|
||||
const user = Meteor.users.findOne(userId);
|
||||
if (user?.isAdmin)
|
||||
return true;
|
||||
if (!user) {
|
||||
|
|
@ -96,8 +96,8 @@ if (Meteor.isServer) {
|
|||
}
|
||||
return doc._id === userId;
|
||||
},
|
||||
async remove(userId, doc) {
|
||||
const user = await ReactiveCache.getUser(userId) || await ReactiveCache.getCurrentUser();
|
||||
remove(userId, doc) {
|
||||
const user = Meteor.users.findOne(userId);
|
||||
if (user?.isAdmin)
|
||||
return true;
|
||||
if (!user) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue