Drupal JSON:API授权

如何解决Drupal JSON:API授权

我正处于弄清楚Drupal JSON API的早期阶段,无法弄清楚是什么原因导致了响应中的Some resources have been omitted because of insufficient authorizationThe current user is not allowed to GET the selected resource

我应该使用标题吗?都是本地的,所以没有基本的身份验证可以通过。

我的代码:

  fetch('http://localhost/domain-6/jsonapi/group_content/microsite-group_menu-main',{
    method: 'GET',mode: 'no-cors',headers: {
      'Accept': 'application/vnd.api+json','Content-Type': 'application/vnd.api+json'
    }
  })
  .then(response => response.json())
  .then(data => {
    console.log(data);
  })
  .catch((error) => {
    console.error('Error: ',error);
  });

响应:

{"jsonapi":{"version":"1.0","meta":{"links":{"self":{"href":"http:\/\/jsonapi.org\/format\/1.0\/"}}}},"data":[],"meta":{"omitted":{"detail":"Some resources have been omitted because of insufficient authorization.","links":{"help":{"href":"https:\/\/www.drupal.org\/docs\/8\/modules\/json-api\/filtering#filters-access-control"},"item--XQp4cup":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/470ce30a-b29a-440c-9dfd-62ec2ecc2174","meta":{"rel":"item","detail":"The current user is not allowed to GET the selected resource."}},"item--1lQ8DZL":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/fd53a4be-b3b3-4fba-8739-fe10bf3594b5","item--CMmFdif":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/44e9ad5d-f644-49d4-9b06-8393fe9f179b","item--35OuqGr":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/993f1dd0-7479-42f2-8cdb-4ad37f69b08d","item--S9wgeIz":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/5d327513-431a-47fc-ad60-7d118cb75e28","item--GadCb5C":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/73420f3a-f77b-40bc-b72c-0529c7c4a7e0","item--whX9lWC":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/186316e4-42a5-4551-b3e3-f2d8d0c924b3","item--0ZPeOPd":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/2b309be4-721d-4000-ab31-811b4c04b15e","item--rMyrlTp":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/bdfc8224-04a9-4795-add5-f363c2433229","item--59LnH0e":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/c5dcd0f8-b594-4567-b15f-a0a64b5186b7","item--3WKSiq1":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/9e76a2a3-e121-4650-b83e-f9425c17a4bf","item--jjQ9TP2":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/ae2b6217-be02-49de-9e01-b6c4a9b67e72","item--dhiafhE":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/61119a05-877c-44c8-940b-fab317c0dc5d","item--c7850PO":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/d636ea7f-f453-47e5-9536-c2b8f3f50c92","item--ngkUSZk":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/a0f48948-e846-4d23-9bbf-4d4b7ccc3507","item--2oP7rlR":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/a6625804-294c-493b-a904-fb1f561573c6","item--Sz5wBPb":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/267f6042-ad6e-411e-8925-006877a7c9ad","item--tMDa2oF":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/ccf1fd6a-921e-4144-97bf-e7d85b4dbdf8","item--vYs3zKx":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/7187c2ba-6ee7-435c-9166-3fc0ce8fb421","item--5vJmCru":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/10ba20cc-f0b6-4365-9b34-221452e4a0fc","item--23KRMeA":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/5096f25f-4359-4cb7-9ec0-335b088d24bd","item--exhD7mi":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/be7d1151-8f65-4eef-8fdc-a936a6cde937","item--UISA0FF":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/89fdb64c-6e33-4237-8137-fad965fb7614","item--Fzg9qbP":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/b69894a9-e7b0-4d63-aecb-069ae054c09f","item--qPBbJA1":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/ae6d8f9b-0725-4fee-9c5d-cd25c8bbe583","item--EqTCJ1N":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/f6c7d183-ff1a-497c-9dac-51d7bd927150","item--uF6v1TR":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/b2db9f2e-1907-4fdf-aa49-1370d0bcf54d","item--MV28pBq":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/8313b799-5f10-4416-ba20-49c2de2834a9","item--wVd7rsP":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/346bdf69-93ec-4127-a483-e7d687b20e2d","item--h0VjXuJ":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/052730d5-18f5-47fb-834f-8ed6898031e1","item--fcA5aED":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/fcdebbce-047b-4cfa-a185-67ae7e01262c","item--3dDdcIg":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/450b3119-4d70-41ee-aecf-6ffe77e76f71","item--3XlVwNC":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/917f9200-6a48-40e2-9c56-e3834fe392f3","item--QtN7OYa":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/de886c77-ebd0-41de-a4ee-872113f6afec","item--Q6uGw9H":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/9ede015d-28b5-4e61-a3ad-1a65b0527f34","item--qwxls5H":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/f12a3922-26c2-47b1-8e62-ff7efb9b005a","item--ngPbsJJ":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/e4540be8-f206-46de-94a6-57a5f7b20ab3","item--AnR0WT0":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/2d0a7020-11d4-4536-a446-fc8450a31559","item--AhzT8c6":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/402e1e71-ec7c-46c4-bc5b-a3b925df70b4","item--Wm2v9pb":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/4f475314-c892-43ab-bb0f-5e1d265cc4d0","item--kd0J901":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/78909988-22e9-491d-a47e-229c0a7a225e","item--404rztx":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/a13ff285-dfda-4949-b85d-67af424fdc92","item--G4zUasD":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/afc8da9b-b945-4013-b4e6-7cfda013b57c","item--hC13Nrz":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/61c25a67-06ed-4831-8f25-e4849632a91e","item--PWp8vHM":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/7c3fa94e-4d4c-4a74-b5ee-8909d2481054","item--Nzyn35g":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/cd43deee-5f44-4f23-9708-58163cd8150d","item--IZapjnH":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/5fc7df8b-1429-4c05-b0d0-6042f53992ad","item--Tf1PVbP":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/ae718931-248f-4d8f-9923-626445d66056","item--WIAJdC5":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/804424f6-bf31-4689-a935-dd92082325e2","item--g2Rs5um":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main\/24d7998f-eca9-4c7e-9ddc-f544e0cab691","detail":"The current user is not allowed to GET the selected resource."}}}}},"links":{"next":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main?page%5Boffset%5D=50\u0026page%5Blimit%5D=50"},"self":{"href":"http:\/\/localhost\/domain-6\/jsonapi\/group_content\/microsite-group_menu-main"}}}

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐


依赖报错 idea导入项目后依赖报错,解决方案:https://blog.csdn.net/weixin_42420249/article/details/81191861 依赖版本报错:更换其他版本 无法下载依赖可参考:https://blog.csdn.net/weixin_42628809/a
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下 2021-12-03 13:33:33.927 ERROR 7228 [ main] o.s.b.d.LoggingFailureAnalysisReporter : *************************** APPL
错误1:gradle项目控制台输出为乱码 # 解决方案:https://blog.csdn.net/weixin_43501566/article/details/112482302 # 在gradle-wrapper.properties 添加以下内容 org.gradle.jvmargs=-Df
错误还原:在查询的过程中,传入的workType为0时,该条件不起作用 <select id="xxx"> SELECT di.id, di.name, di.work_type, di.updated... <where> <if test=&qu
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct redisServer’没有名为‘server_cpulist’的成员 redisSetCpuAffinity(server.server_cpulist); ^ server.c: 在函数‘hasActiveC
解决方案1 1、改项目中.idea/workspace.xml配置文件,增加dynamic.classpath参数 2、搜索PropertiesComponent,添加如下 <property name="dynamic.classpath" value="tru
删除根组件app.vue中的默认代码后报错:Module Error (from ./node_modules/eslint-loader/index.js): 解决方案:关闭ESlint代码检测,在项目根目录创建vue.config.js,在文件中添加 module.exports = { lin
查看spark默认的python版本 [root@master day27]# pyspark /home/software/spark-2.3.4-bin-hadoop2.7/conf/spark-env.sh: line 2: /usr/local/hadoop/bin/hadoop: No s
使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams['font.sans-serif'] = ['SimHei'] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -> systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping("/hires") public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate<String
使用vite构建项目报错 C:\Users\ychen\work>npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-