#Cloud deployment no admin privileges?

24 messages · Page 1 of 1 (latest)

short spindle
#

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.

safe glade
#

Hey @short spindle - I have replicated and am looking into this 👋

safe glade
#

@short spindle 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!

safe glade
#

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

short spindle
#

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

short spindle
#

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

short spindle
#

Ok deleted the cloud instance and tried again now its working

opaque lily
#

@safe gladethis seems to be not a solution. Still the issue is there.

opaque lily
#

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.

#

@safe glademay check this and please update repository.

#

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

opaque lily
#

@safe gladeanother guess is that PoplateArchiveBlock hook has something weired in it.

safe glade
#

Hi @opaque lily - to clarify, your issue is that after clicking 'save draft' on a page it returns the nothing found page?

opaque lily
#

Yes that is for page and posts collection.

safe glade
#

@opaque lily 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?

opaque lily
#

@safe gladeI am talking about cloud installation. The issue is there.

safe glade
#

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

opaque lily
#

yes

safe glade
#

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

opaque lily
#

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.

safe glade
#

@opaque lily I'm trying to replicate again

safe glade
#

@opaque lily 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',
    },
  }
}
opaque lily
#

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

#

@safe gladeThank you very much