Small fixes: optional R2_PUBLIC_URL, seo.uploadsCollection, staff features without roles
- ipalEnvRules({ storage: true }): R2_PUBLIC_URL optional (media served by
the app); storage: { requirePublicUrl: true } requires it again.
- seo.uploadsCollection: upload collection of the meta image (default media).
- userMeetsRole(req, minimum): the plugin's admin/editor features (Site
Integrations, settings globals, test e-mail, stats, consent records, form
submissions) stay reachable when `access` is omitted — without a roles
field every logged-in account passes, as in Payload's default.
- IndexNow skip for seed writes is covered by test/seed.test.ts.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
cff76c2a69
commit
4911da7112
@@ -1,6 +1,6 @@
|
||||
import type { CollectionConfig, Endpoint, PayloadRequest } from 'payload'
|
||||
|
||||
import { isAdmin } from '../access/predicates.js'
|
||||
import { userMeetsRole } from '../access/predicates.js'
|
||||
import { createDailyPurge } from '../shared/purge.js'
|
||||
import { clientIp, consumeRateLimit } from '../shared/rateLimit.js'
|
||||
import { CONSENT_CATEGORIES } from './categories.js'
|
||||
@@ -30,8 +30,8 @@ export function buildConsentLogCollection(): CollectionConfig {
|
||||
access: {
|
||||
// Written only by the endpoint (Local API); read and pruned by admins.
|
||||
create: () => false,
|
||||
delete: ({ req: { user } }) => isAdmin(user),
|
||||
read: ({ req: { user } }) => isAdmin(user),
|
||||
delete: ({ req }) => userMeetsRole(req, 'admin'),
|
||||
read: ({ req }) => userMeetsRole(req, 'admin'),
|
||||
update: () => false,
|
||||
},
|
||||
admin: {
|
||||
|
||||
Reference in New Issue
Block a user