📄️ Overview
Policies in Tarobase are the backbone of your application's security and data integrity. They define the rules for data access, storage, and actions within your app. By carefully crafting policies, you can control who can read or write data, enforce data structures, decide whether data is stored on-chain or off-chain, and automate actions based on data changes.
📄️ The Basics
Policy Structure
📄️ Writing Effective Policies
Defining Paths with Dynamic Segments
📄️ On-Chain Storage
To specify that data should be stored on-chain, set the "onchain" property to true. This will deploy or update a smart contract on the blockchain to handle the data storage. It's important to note that ALL data for any new data created on-chain is entirely public.
📄️ Hooks: Integrating Composable Onchain Actions
Hooks allow you to automate onchain actions to occur after a write operation passes the rules.
📄️ Best Practices for Secure and Scalable Policies
Principle of Least Privilege