ledgers 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. Ledger
  2. **************************
  3. a legder is a table of records that holds the history of an org, and of modpol itself.
  4. its structure is a table of legder entries.
  5. Every org has one, starting with the entry recording its creation.
  6. Ledger Entry
  7. **************************
  8. a legder entry is a table with the following properties:
  9. timestamp = nil,
  10. entrytype = nil,
  11. action_msg = '',
  12. the timestamp will hold the output of os.time at the moment the entry was created.
  13. the entrytype is optional; it can hold an identifier of the kind of entry it is (e.g. 'org_init', 'new_user', etc etc.)
  14. action_msg is the record output itself.
  15. Entrytypes
  16. **************************
  17. These are the entrytypes that modpol uses. Each additional module should document whatever entrytypes it adds.
  18. 'org_init'
  19. type used when an org is created
  20. 'org_purge'
  21. type used when all orgs are purged. -- will only be found in the main modpol ledger.
  22. 'org_remove'
  23. type used when removing an individual org
  24. 'add_member'
  25. type used when adding a member to an org
  26. 'remove_member'
  27. type used when removing a member from an org
  28. Old orgs
  29. **************************
  30. when an org is removed, its ledger is stored in modpol.old_legders = {} Note that multiple ledgers may exist here with the same org name.