Search…
Audit

Custom Objects

Audit logs can be associated with custom objects using a script.
1
import audit from 'audit'
2
3
// Create custom object
4
org.objects.objects.insertOne({
5
label: 'My Object',
6
name: 'my_object',
7
defaultAcl: 'owner.delete',
8
createAcl: 'account.public',
9
properties: [
10
{
11
label: 'name',
12
name: 'c_name',
13
type: 'String',
14
indexed: true
15
}
16
]
17
})
18
.execute()
19
20
// Create audit record
21
return audit.record('my_object', org.objects.my_object._id, 'create', {
22
metadata: {
23
message: 'record created'
24
}
25
})
Copied!

record(title, objectId, action, options)

Arguments
    title { String }
    objectId { ObjectID }
    action { String } e.g (create, read, update, delete, access, transfer)
    options { Object } Options object
      metadata { Object }
      err {Fault}
Last modified 1mo ago