Set policies from code
Set or replace a table's policy over MCP, REST or when you create the table.
Only the project owner can set policies. Each call replaces the entire policy of one table.
Over MCP
Use the policies section of the build tool. Calling build without arguments returns the current rules, the columns of each table and any invalid rules.
{ "space": "Kanban", "policies": [{ "table": "Tasks", "rules": "read_all_own" }] }To set rules when creating a table, pass rules to create_table. Tables meant for an application should have rules from the start.
Over REST
/api/spaces/{project}/policiesRead the policies of every table in the project./api/spaces/{project}/policiesReplace the policy of one table.{ "table": "Tasks", "policies": [{ "action": "select", "using": "true" }] }policies accepts an array of rules, a preset name or null. These endpoints use the owner's session or personal access token; project API keys (thk_) cannot change policies.
Acting as the caller in Think Service
In a Think Service route, store.asViewer() reads and writes under the caller's role and the table's policies.