Skip to content

Commit 604c8d3

Browse files
committed
perf(core): improved access to collection logs
1 parent b791072 commit 604c8d3

3 files changed

Lines changed: 12 additions & 2 deletions

File tree

src/collections/auditor.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,20 @@ export type AuditorLog = {
1818

1919
const auditor: CollectionConfig = {
2020
slug: defaultCollectionValues.slug,
21+
access: {
22+
admin: () => false,
23+
create: () => false,
24+
delete: () => false,
25+
read: () => false,
26+
readVersions: () => false,
27+
unlock: () => false,
28+
update: () => false,
29+
},
2130
admin: {
2231
defaultColumns: ['operation', 'type', 'collection', 'user', 'timestamp'],
2332
useAsTitle: 'operation',
2433
},
34+
auth: true,
2535
fields: [
2636
{
2737
name: 'operation',

src/pluginUtils/configHelpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ export const buildAccessControl = (pluginOpts: PluginOptions) => {
5454
}
5555
})
5656

57-
auditor.access = access
57+
auditor.access = { ...auditor.access, ...access }
5858
}
5959

6060
export const attachCollectionConfig = (

src/utils/toMS.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { cleanupStrategiesDefaultValues } from 'src/Constant/automation.js'
1+
import { cleanupStrategiesDefaultValues } from './../Constant/automation.js'
22

33
export type Duration = `${number}${'d' | 'h' | 'm' | 'mo' | 's' | 'w' | 'y'}`
44
const ms = (duration: Duration = cleanupStrategiesDefaultValues.manual.olderThan): number => {

0 commit comments

Comments
 (0)