Simplify your stack and build anything. Or everything.
Build tomorrow’s web with a modern solution you truly own.
Code-based nature means you can build on top of it to power anything.
It’s time to take back your content infrastructure.

Cloud deployment no admin privileges?

default discord avatar
captken.2 years ago
14

Can not create a page or a category as Admin after deploying the cloud standard website, anyone have this issue or am i missing something simple? I can create another user so I am baffled after looking through the config? Any help appreciated.

  • default discord avatar
    jessrynkar2 years ago

    Hey

    @895705628754968577

    - I have replicated and am looking into this 👋



    @895705628754968577

    we found the problem - if you go to your payload config, comment out lines

    46/47

    for cors/csrf and this problem should resolve. I'll be updating the template so this doesn't happen in the future!



    This is fixed in the template now, pull in the changes there and it should work as expected

  • default discord avatar
    captken.2 years ago

    Thanks for the update - Jess, will give it a try tonight



    @854377910689202256

    - unfortunately that not working on my end - also noticed on git - //cor: are on lines 44 and 45 you have 46 and 47



    Ok deleted the cloud instance and tried again now its working

  • default discord avatar
    pcbal2 years ago
    @854377910689202256

    this seems to be not a solution. Still the issue is there.



    After uncommenting those two lines and adding slug manually resolves the issue. That means the slug generator is not working with input from title field and ends up in undefined.



    @854377910689202256

    may check this and please update repository.



    @854377910689202256

    Again the save draft does not work here. I could publish directly after a slug input. Save draft returns nothing found page.



    @854377910689202256

    another guess is that PoplateArchiveBlock hook has something weired in it.

  • default discord avatar
    jessrynkar2 years ago

    Hi

    @1081840618944340050

    - to clarify, your issue is that after clicking 'save draft' on a page it returns the

    nothing found

    page?

  • default discord avatar
    pcbal2 years ago

    Yes that is for page and posts collection.

  • default discord avatar
    jessrynkar2 years ago
    @1081840618944340050

    I haven't been able to replicate this - we pushed a few updates to the template last week, can you check you have all the latest changes?

  • default discord avatar
    pcbal2 years ago
    @854377910689202256

    I am talking about cloud installation. The issue is there.

  • default discord avatar
    jessrynkar2 years ago
    @1081840618944340050

    I understand that you've created this project from payload cloud - which template did you select? the website starter?

  • default discord avatar
    pcbal2 years ago

    yes

  • default discord avatar
    jessrynkar2 years ago
    @1081840618944340050

    and if you start another project using the website starter, are you seeing the same issue?

  • default discord avatar
    pcbal2 years ago

    yes everytime. I tried this several times after removing entirely the project and redoing. but still there is this issue. when I checkout the repo to local and change access control methods using the files available in website-cms repo and modify formatslug.ts a bit the issue is over locally. I didnt replace that remote.

  • default discord avatar
    jessrynkar2 years ago
    @1081840618944340050

    I'm trying to replicate again



    @1081840618944340050

    the

    adminOrPublished

    read access control wasn't checking the

    admin

    role correctly, I've pushed a fix to the repo, try that and let me know how it goes.



    Or you can update the

    src/access/adminOrPublished.ts

    file in your repo to this:



    import type { Access } from 'payload/config'
    import { checkRole } from '../collections/Users/checkRole'
    
    export const adminsOrPublished: Access = ({ req: { user } }) => {
      if (user && checkRole(['admin'], user)) {
        return true
      }
    
      return {
        _status: {
          equals: 'published',
        },
      }
    }
  • default discord avatar
    pcbal2 years ago

    Yes, That did it...!!!!. I made a direct commit to the file and tested it. Now working. Thank you for your quick response.



    @854377910689202256

    Thank you very much

  • default discord avatar
    jessrynkar2 years ago
    @1081840618944340050

    woo woo happy to help! 🙌

Star on GitHub

Star

Chat on Discord

Discord

online

Can't find what you're looking for?

Get dedicated engineering support directly from the Payload team.