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

Admin access to the repository is required in order to save #303

Open
MagicLegend opened this issue Jan 12, 2025 · 2 comments
Open

Admin access to the repository is required in order to save #303

MagicLegend opened this issue Jan 12, 2025 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@MagicLegend
Copy link

Hi!

Some users have reported they are unable to save content in the rewrite of the CMS that we're working on. The common denominator is that those users all are not admin on the repository. I am, and I don't have issues. I already confirmed that this is indeed the issue, when I promote them to admin (which I'd rather not leave permanently) suddenly the error disappears. The error they see in their devtools:

image

Our config is a bit of a special one, as it's being bundled by Vite starting from here: https://github.com/DIVD-NL/web-www-v2/blob/main/cms/app.ts

What did I configure wrong that is causing our users to need to be admin on the repository in order to write?

You can look at the cms by cloning the repository and running npx vite. Hugo is not required for the CMS stuff. Note that the second configuration at https://github.com/DIVD-NL/web-www-v2/blob/main/admin/config.yml is our legacy config, we're in process of porting this to the TS format for better reusability.

Thanks!

@kyoshino
Copy link
Member

kyoshino commented Jan 12, 2025

Will check.

@kyoshino
Copy link
Member

Sorry to be late here. I’m testing with a sample repo with a test account invited as the Write role, but it’s working fine. (The Read role doesn’t work at all, but it’s a different issue.)

The error in the screenshot comes from:

return result.createCommitOnBranch.commit.url;

But I don’t think this GraphQL API createCommitOnBranch method is limited to admin.

Do you see any error message in an API response when you open the Network tab in DevTools? A successful response looks like this:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants