Skip to main content
vly’s built-in auth includes a role-based access control (RBAC) system. Every project starts with three roles — owner, admin, member — and you can add more or rename them.

The default roles

The exact permissions depend on your app — vly generates the role check pattern but you decide who can do what.

Adding a role

vly:
  1. Adds viewer to the role enum in the schema.
  2. Updates every mutation to refuse if the caller is a viewer.
  3. Adds the new role option in the workspace member UI.

Resource-level scoping

Beyond role-level permissions, scope by who owns a resource:
The pattern in code:
convex/tasks.ts
vly generates this pattern when you describe role-aware behavior in a prompt.

Common patterns

Owner-only billing

“Only owners can change the workspace plan or update billing details.”

Admin-only invites

“Admins and owners can invite new members. Members cannot.”

Self-service for members

“Members can edit their own profile, but not other members’.”

Public read, restricted write

“Anyone signed in can read all resources; only the creator can edit.”

Tips

Define roles in plain English in the prompt. “Members can do X but not Y” is clearer than trying to enumerate every permission.
Test by signing in as different roles. Don’t trust that the agent generated the right checks — sign in as a member and try to do admin-only actions.

Built-in auth

The auth system.

Workspace roles

Workspace-level role management.

Auth flows

Architectural patterns.
Last modified on April 18, 2026