wwwfiberdirekt/src/access/adminOnly.ts
Jeffrey ed4062aef0 feat: add admin/editor roles to users, restrict globals to adminOnly
- Users: added role field (admin/editor), role field locked to adminOnly update
- SiteSettings, AnnouncementBar, PopupAnnouncement: update restricted to adminOnly
- Added src/access/adminOnly.ts helper
2026-02-18 16:04:48 +01:00

6 lines
131 B
TypeScript

import type { Access } from 'payload'
export const adminOnly: Access = ({ req: { user } }) => {
return user?.role === 'admin'
}