0

I have an issue with creating a node via rest API. I have the correct permissions setup but it seems like a glitch somewhere in the permissions. An admin can create a content but no other role can.

{content_type}: Can create new content permission is checked.

Getting access denied error along with the username in the logs.

Config:

enter image description here

Client:

return api({
    method: 'post',
    url: 'node?_format=hal_json',
    data: JSON.stringify(_node),
    headers: {
        'Content-Type': 'application/hal+json',
        'X-CSRF-Token': _xscrf_token,
    },
});

2 Answers 2

0

Url should be /entity/node?_format=hal_json

1
  • What difference does this make in terms of user roles? 'An admin can create a content but no other role can' - that's my issue. Jun 2, 2020 at 16:37
-1

Make sure you check the correct permissions for the roles you want in the "RESTful Web Services" section on the /admin/people/permissions page.

1
  • The permissions are right. There is an issue with Drupal. If the role is given "Administer content" permission, the issue resolves. But that shouldn't be the case. Feb 14, 2020 at 10:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.