directus-labs / directus-template-cli

Apply "templates" to a new, empty Directus project.
MIT License
88 stars 15 forks source link

Getting: "You don't have permission to access this" when applying the directus export #40

Closed plasebo closed 2 months ago

plasebo commented 1 year ago

Hello Bryant,

Have created a Directus instance on my local machine via Docker and customized it to my needs. Already added more than 100 records. Was very interested in your cli solution since I can import the assets and content together with the schema onto another Directus instance.

I've tried to apply the extracted data via the following command: npx directus-template-cli@latest apply onto my server which support Docker too, using the cli, sh, from Portainer GUI. However, I'm getting the following errors:

{
    message: "You don't have permission to access this.",
    extensions: { code: 'FORBIDDEN' }
}

Getting the same error on all my collections.

Can you please advise...

Thanks in advance,

bryantgillespie commented 1 year ago

Seems like an issue with the token. Did you save the user inside Directus after creating the token?

plasebo commented 1 year ago

Yeah, use the administrator user, that was already created on the fresh Directus. The admin token was accepted and upon processing the template data, the log raised that the administrator user already exist.

Upon proceeding, my assets, flows and other users were created, however schema did not appear. Got errors as mentioned in my above thread.