#Cloud deployment no admin privileges?
24 messages · Page 1 of 1 (latest)
Hey @short spindle - I have replicated and am looking into this 👋
@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!
This is fixed in the template now, pull in the changes there and it should work as expected
Thanks for the update - Jess, will give it a try tonight
@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
Ok deleted the cloud instance and tried again now its working
@safe gladethis 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.
@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.
@safe gladeanother guess is that PoplateArchiveBlock hook has something weired in it.
Hi @opaque lily - to clarify, your issue is that after clicking 'save draft' on a page it returns the nothing found page?
Yes that is for page and posts collection.
@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?
@safe gladeI am talking about cloud installation. The issue is there.
@opaque lily I understand that you've created this project from payload cloud - which template did you select? the website starter?
yes
@opaque lily and if you start another project using the website starter, are you seeing the same issue?
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.
@opaque lily I'm trying to replicate again
@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',
},
}
}