Possible typo on collection access control docs

default discord avatar
thisisnotchris
7 months ago
12

Hello Payload team! Just wanted to check if the example on this section is correct.

https://payloadcms.com/docs/access-control/collections

"Example Collection config"



Should it be returning "Categories" or "Posts"?



@jmikrut



import { CollectionConfig } from 'payload/types';

const Posts: CollectionConfig = {
  slug: "posts",
  access: {
    create: ({ req: { user } }) => { ... },
    read: ({ req: { user } }) => { ... },
    update: ({ req: { user } }) => { ... },
    delete: ({ req: { user } }) => { ... },
    admin: ({ req: { user } }) => { ... },
  },
};

export default Posts;


Fixed ^



also tagging @patrikkozak @jesschow, as this is a commonly viewed example



Also tagging @denolfe in case this got buried in the queue

  • default discord avatar
    Jarrod
    7 months ago

    yes this is a type O

  • default discord avatar
    thisisnotchris
    7 months ago

    I think I'm AB Positive



    not sure

  • default discord avatar
    Jarrod
    7 months ago

    😃

  • default discord avatar
    thisisnotchris
    7 months ago

    also I didnt ping you @Jarrod because I felt bad for pinging you a bunch last week

  • discord user avatar
    denolfe
    Payload Team
    7 months ago

    Updated in master

  • default discord avatar
    Jarrod
    7 months ago

    @thisisnotchris no need to feel bad!

  • discord user avatar
    jesschow
    Payload Team
    7 months ago

    feel

    afraid
Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.