Filter
filter: `({ action, params, context, util }) => {
if (action === "player.remove") {
return context.user.player.isAdmin && context.user.player.id != params.id;
} else if (action === "player.create") {
return context.user && (!context.user.player || context.user.player.isAdmin);
}
return true;
}`,
}, {
description: "player can get associated team, admin can get all the teams",
actions: ["team.get"],
scopes: ["player", "player.admin"],
filter: (({ action, params, context, util }) => {
if (context.user.player.isAdmin || params.id === context.user.player.teamId) {
return true;
}
return false;
}).toString(),
},
],Last updated
Was this helpful?