nursery/useConvexAccessControl
nursery · since 2.6.10
No autofixRecommended
biome.json
{
"linter": {
"rules": {
"nursery": {
"useConvexAccessControl": "error"
}
}
}
}Require public Convex functions to call an access control function.
import { mutation } from "./_generated/server";
export const send = mutation({
args: {},
handler: async (ctx) => {
await ctx.db.insert("messages", { body: "hello" });
},
});import { internalMutation, mutation, query } from "./_generated/server";
export const list = query({
args: {},
handler: async (ctx) => {
const user = await requireUser(ctx);
},
});
export const update = mutation({
args: {},
handler: async (ctx) => {
if (!(await canEditNote(ctx))) {
throw new Error("Unauthorized");
}
},
});
export const remove = mutation({
args: {},
handler: async (ctx) => {
await authz.require(ctx, "documents:delete");
},
});
export const cleanup = internalMutation({
args: {},
handler: async (ctx) => {
await ctx.db.delete("messages", messageId);
},
});Examples from the Biome documentation.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/useConvexAccessControl
nursery · since 2.6.10
{
"linter": {
"rules": {
"nursery": {
"useConvexAccessControl": "error"
}
}
}
}Enforce JSON keys with consistent Unicode representation.
Require an args validator in Convex queries, mutations, and actions.
Require kind sets in Biome JS plugins to be created at the top level of the module.
Require the table name as the first argument of Convex database calls.
Require kind sets instead of comparing kind names one by one in Biome JS plugins.
Require a reason when using the @deprecated directive.