Add Sample/Initial Data
Now, we need to add in our sample data. For the purposes of this example, we'll be creating five users, five auth records, and one role. At this point, the role won't be connected to any rules, but we will add rules next.
To create 5
_users, we will need to specify 5
username (losDelRio, softCell, dexysMidnightRunners, rightSaidFred, and toniBasil). Each of those users should have a predicate,
auth, which references a tempid for an auth record (we use
_auth$2, etc. See tempids if you need a review).
_user/auth is a multi predicate, the specified object of the predicate needs to be inside of an array. For example is part of the transaction:
Each auth record should have a
_auth$followed by a tempid (1, 2, 3, 4, 5)
doc: "Basic auth record"
roles: a reference to the role (explained below). You'll need to use a tempid, and surround the reference by
_auth/rolesis a multi predicate.
The role should have a
_role$voter, so we can reference it in other parts of the transaction.
doc: "A voter can view and edit changes, votes, and users. They cannot edit, auth records."
Add Auth, Users, Role
Use the directions above to add 5 users, 5 auth records, and one role to our ledger.