Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(templates): ecommerce template v3 #8297

Draft
wants to merge 1 commit into
base: beta
Choose a base branch
from

Conversation

paulpopus
Copy link
Contributor

No description provided.


export const adminsOrPublished: Access = ({ req: { user } }) => {
if (user) {
return checkRole(['admin'], user)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is a draft PR, but shouldn't this be like this:

if (user) {
  if (checkRole(['admin'], user)) { 
    return true
  }
}

If you are logged in, but not an admin, we still need to check if the page status is published or not.

The current version will return false for a logged in normal user even if the page status is marked as published

@jcourson8
Copy link

I've just been trying to get it to ~work~ with the latest beta. I made a lot of changes- some type related, some updating to latest api. I started with the payload-vercel-postgres-template and then once I got it to work I moved over to the feat/ecommerce-template branch and tried to merge it in. Not sure if this is even a help at all, but though I would just put it here in case it is.

https://github.com/jcourson8/payload/tree/feat/ecommerce-3-update

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants