Setting Up Access Rules for Large Apps

Set up Data Access Control in a Knack app with many tables and user roles. Plan access by group, set defaults first, and have your AI tool apply rules in batches you check as you go.

What You'll Learn

Setting up Data Access Control in a large Knack app takes planning, because access rules are set one table and one role at a time. This article shows how to plan access by group, set defaults before you add more tables, have your AI tool apply rules in batches, and check each batch before you turn on enforcement.

Why Access Rules Take Longer in Large Apps

Every table needs two settings for every user role: one for records the user owns, and one for all other records. The Knack Builder sets them one at a time, with no way to apply a setting to a whole role or a whole group of tables at once.

That adds up fast. An app with 150 tables and 5 roles has 1,500 settings to make.

Apps built with a frontend builder like Lovable or Base44 often have a lot of tables, so this comes up more than you'd expect.

📘

Your AI tool works one setting at a time too

An AI tool connected through the Knack MCP Server can make the changes for you, but it still makes each one individually. In one large build, that came to more than 1,300 changes. It saves you the clicks, not the time, so plan for it.

Plan Access by Group Before You Start

Don't plan table by table. Sort your tables into groups by who should see them, then decide access for each group once.

GroupExample tablesExample access
Admin onlyBilling, payroll, settingsNo Access for everyone except admins
Staff workSessions, notes, schedulesStaff can edit, families can't see
Shared with the personAppointments, documents, goalsThe person sees their own records
Reference listsService types, locationsMost roles can view

For each group, write down two settings per role: Owned By User and All Other Records. Owned By User can be Full Access, Edit Only, or View Only. All Other Records adds a fourth option, No Access. This short table becomes the plan your AI tool follows, and the checklist you review against.

📘

Shared records depend on ownership

If a person should see records that staff create for them, those records need to be owned by that person. Plan ownership alongside access. See Who Owns a Record Created from a Custom Frontend.

Set Defaults Before You Add More Tables

Each role can have default permissions that new tables pick up automatically. Defaults only apply to tables created after you set them. They don't change tables that already exist.

Set restrictive defaults early, so every table you add later starts closed instead of open. A good starting point for most roles is No Access for All Other Records. See Setting Up and Enforcing Data Access Control for where to set defaults.

Start Closed, Then Open Access by Group

Lead with the most secure setting and open access only where your plan calls for it.

  1. Set All Other Records to No Access for every role except admins, on every table
  2. Open access one group at a time, following your plan
  3. Leave the Public (Not Logged-In) role at No Access for All Other Records on every table unless a table is meant to be public

Starting closed means a table you forget stays locked. Starting open means a table you forget stays exposed.

Have Your AI Tool Apply Rules in Batches

Give your AI tool your plan and have it work through one group at a time. Start with a read-only pass so you know what's set today.

Using the Knack MCP, call loadSkill first.

Read-only. Make no changes.

List every table and the current Owned By User and All Other Records setting for each user role. Group the tables the way I describe below, and flag any table you can't place in a group.

[Paste your group plan here]

Then apply one group at a time.

Apply access rules for the [group name] group only, using my plan.

For each table in this group, set Owned By User and All Other Records for each role exactly as planned. Do not change any other tables. Do not turn on enforcement.

When you finish, list every change you made and stop. Wait for me to review before starting the next group.

Keep tool permissions on "ask each time" for the first batch so you can watch the changes run. Once you've confirmed the pattern is right, you can loosen permissions for later batches.

Check Each Batch in the Knack Builder

AI tools sometimes report a change as done when it didn't happen. After each batch, open Users > All Users > Data Access in the Knack Builder and check it yourself.

  • Filter the grid to one role at a time, so you're comparing one column against your plan
  • Check every table in the batch, not a sample
  • Confirm the Public (Not Logged-In) role still shows No Access for All Other Records on every table

Fix anything that's off before starting the next batch. Errors are easier to catch in a batch of 15 tables than in a finished grid of 150.

Turn On Enforcement Last

Your rules don't protect anything until enforcement is on. Turn it on after every batch is applied and checked.

Then test as each role on your published app. See Checking That Your Access Rules Actually Work for how to confirm Knack is enforcing your rules, not just your screens hiding records.

Common Mistakes

  • Planning table by table. Group your tables first. You'll make the same decision a few times instead of 150 times.
  • Setting defaults after the tables exist. Defaults only apply to new tables. Set them early.
  • Starting open and locking down later. Any table you miss stays exposed. Start closed.
  • Running every table in one batch. Mistakes multiply and are hard to find. Work one group at a time and check each one.
  • Trusting the AI tool's summary. Check every batch in the Builder before moving on.
  • Forgetting to turn on enforcement. Configured rules do nothing until enforcement is on.
📘

For developers

The MCP Server's manageKnackAccessControl tool sets one permission per call with update_permission (one role, one table, Owned or Other). get_permission_matrix returns current settings for several roles at once, up to 150 tables per page, and accepts a searchTerm to filter tables by name. set_default_role marks the app's default role and accepts defaultOwnedPermissions and defaultOtherPermissions for that role's permissions on new tables. Defaults for other roles are set in the Builder.

Next Steps


Did this page help you?