{"id":18137,"date":"2022-10-09T09:05:05","date_gmt":"2022-10-09T00:05:05","guid":{"rendered":"http:\/\/www.code-magagine.com\/?p=18137"},"modified":"2023-05-27T17:42:30","modified_gmt":"2023-05-27T08:42:30","slug":"%e3%80%90hasura%e3%80%91%e3%80%8cpermission%e3%80%8d%e3%81%ab%e3%81%a4%e3%81%84%e3%81%a6","status":"publish","type":"post","link":"http:\/\/www.code-magagine.com\/?p=18137","title":{"rendered":"\u3010Hasura\u3011\u30c6\u30fc\u30d6\u30eb\u306e\u8a2d\u5b9a\uff08\u300c\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7\u300d\u3001\u300cPermissions\u300d\uff09\u306b\u3064\u3044\u3066"},"content":{"rendered":"<h2>\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7<\/h2>\n<p>\u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u5408\u306b\u95a2\u3057\u3066\u3067\u3059\u306d\u3002Hasura\u306eWeb\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u304b\u3089\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u30e6\u30cb\u30fc\u30af\u306a\u3069\u306e\u5916\u90e8\u30ad\u30fc\u5236\u7d04\u306e\u8a2d\u5b9a\uff08Hasura\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u5fc5\u9808\u306b\u306a\u308a\u307e\u3059\u3002\uff09<\/li>\n<\/ul>\n<h3>One to One\uff08Object relationShip)<\/h3>\n<p>1:1\u306e\u95a2\u4fc2\u3067\u3059\u3002\u3069\u3061\u3089\u306e\u30c6\u30fc\u30d6\u30eb\u306b\u3082\u300cUnique\u300d\u5236\u7d04\u3092\u30c1\u30a7\u30c3\u30af\u3092\u3064\u3051\u3066\u3001\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u306b\u3066\u8a2d\u5b9a\u3092\u884c\u3044\u307e\u3059\u3002\u3059\u308b\u3068\u4ee5\u4e0b\u306eGraphQL\u69cb\u6587\u304c\u4f7f\u3048\u307e\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">users {\r\n  parent_id: uuid\r\n}\r\n\r\nparents {\r\n  id: uuid\r\n}<\/pre>\n<p>\u5225\u30c6\u30fc\u30d6\u30eb\u306euuid\u3092\u7d10\u3065\u3051\u307e\u3059\u3002<\/p>\n<h3>One to Many\uff08Array relationShip)<\/h3>\n<p>1:\u591a\u306e\u95a2\u4fc2\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true\">users {\r\n  parent_id: []\r\n}\r\n\r\nparents {\r\n  id: uuid\r\n}<\/pre>\n<h3>Many to Many<\/h3>\n<p>\u591a:\u591a\u306e\u95a2\u4fc2\u3067\u3059\u3002<\/p>\n<pre class=\"lang:default decode:true \">users {\r\n  parent_id: []\r\n}\r\n\r\nparents {\r\n  id: uuid\r\n  frends: []\r\n}<\/pre>\n<p>\u4e2d\u9593\u30c6\u30fc\u30d6\u30eb\u3092\u4f5c\u308b\u306e\u304c\u4e00\u822c\u7684\u3067\u3059\u3002<\/p>\n<h2>Permissions<\/h2>\n<h3>admin<\/h3>\n<p>Hasura\u3067\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u6642\u306b\u30c7\u30d5\u30a9\u30eb\u30c8\u3067\u5272\u308a\u5f53\u3066\u3089\u308c\u3066\u3044\u308bpermissions\u3067\u3059\u3002\u30d5\u30eb\u30a2\u30af\u30bb\u30b9\u3068\u3044\u3046\u3053\u3068\u3067CRUD\u304c\u5168\u3066\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u3063\u3066\u3044\u307e\u3059\u3002<\/p>\n<h3>\u30e6\u30fc\u30b9\u30b1\u30fc\u30b9<\/h3>\n<p>\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u306e\u30e6\u30fc\u30b6\u30fc\u306e\u72b6\u614b\u306b\u5fdc\u3058\u3066\u30c7\u30fc\u30bf\u30d9\u30fc\u30b9\u306e\u30c6\u30fc\u30d6\u30eb\u3092\u3044\u3058\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u6a29\u9650\u3092\u5236\u5fa1\u3059\u308b\u76ee\u7684\u3067\u6d3b\u7528\u3057\u307e\u3059\u3002<\/p>\n<ul>\n<li>\u7ba1\u7406\u8005\u7528\u306e\u6a29\u9650<\/li>\n<li>\u30ed\u30b0\u30a4\u30f3\u3057\u305f\u30e6\u30fc\u30b6\u30fc\u7528\u306b\u306f\u7279\u5b9a\u30c6\u30fc\u30d6\u30eb\u306e\u30d5\u30eb\u30a2\u30af\u30bb\u30b9\u3092\u8a31\u53ef\u3059\u308b\u306a\u3069\u3002<\/li>\n<li>\u30ed\u30b0\u30a4\u30f3\u3057\u3066\u3044\u306a\u3044\u30e6\u30fc\u30b6\u30fc\u7528\u306b\u306f\u4e00\u89a7\u306eselect\u306e\u307f\u3092\u8a31\u53ef\u3059\u308b\u306a\u3069\u3002<\/li>\n<\/ul>\n<h3>\u8a2d\u5b9a\u9805\u76ee<\/h3>\n<h4>Row XXX permissions<\/h4>\n<h5>without any checks<\/h5>\n<p>\u8ab0\u304c\u4f5c\u3063\u305f\u30c7\u30fc\u30bf\u3060\u3068\u3057\u3066\u3082CRUD\u3067\u304d\u308b\u3088\u3046\u306b\u306a\u308a\u307e\u3059\u3002<\/p>\n<h5>With custom check<\/h5>\n<p>CRUD\u3067\u304d\u308b\u6761\u4ef6\u3092\u8ffd\u52a0\u3067\u304d\u307e\u3059\u3002\uff08\u30c7\u30fc\u30bf\u3092\u4f5c\u3063\u305f\u4eba\u3057\u304b\u898b\u308c\u306a\u3044\u3088\u3046\u306b\u3059\u308b\u306a\u3069\uff09<\/p>\n<h5>Limit number of rows<\/h5>\n<p>\u307e\u305f\u4f55\u4ef6\u306e\u307f\u53d6\u5f97\u3055\u305b\u308b\u306a\u3069\u306e\u8a2d\u5b9a\u3082\u3067\u304d\u307e\u3059\u3002<\/p>\n<h4>Column XXX permissions<\/h4>\n<p>\u64cd\u4f5c\u3067\u304d\u308b\u30ab\u30e9\u30e0\u3092\u5236\u9650\u3067\u304d\u307e\u3059\u3002\u5168\u3066\u306e\u30ab\u30e9\u30e0\u3092\u64cd\u4f5c\u3055\u305b\u305f\u3044\u5834\u5408\u306f\u300c<i class=\"_1PMnCBcprUn20MC-H1S9U1\">all columns\u300d\u306a\u3069\u3092\u9078\u3079\u3070\u826f\u3044\u3067\u3057\u3087\u3046\u3002<\/i><\/p>\n<h4>Column presets\uff08INSERT\u3001UPDATE\u306e\u307f\uff09<\/h4>\n<p>\u3053\u308c\u306f\u6a29\u9650\u7cfb\u3068\u3044\u3046\u3088\u308a\u81ea\u52d5\u64cd\u4f5c\u7cfb\u306e\u51e6\u7406\u306b\u306a\u308a\u307e\u3059\u304c\u3001\u767b\u9332\u3084\u66f4\u65b0\u3055\u308c\u305f\u884c\u306b\u5bfe\u3057\u3066\u7279\u5b9a\u30ab\u30e9\u30e0\u306b\u5bfe\u3057\u3066\u4f55\u304b\u7279\u6b8a\u306a\u5024\u3092\u8a2d\u5b9a\u3059\u308b\u3068\u3044\u3046\u3088\u3046\u306a\u64cd\u4f5c\u3092\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u307e\u3059\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u30b7\u30c3\u30d7 \u30c6\u30fc\u30d6\u30eb\u306e\u7d50\u5408\u306b\u95a2\u3057\u3066\u3067\u3059\u306d\u3002Hasura\u306eWeb\u30b3\u30f3\u30bd\u30fc\u30eb\u4e0a\u304b\u3089\u8a2d\u5b9a\u3067\u304d\u307e\u3059\u3002 \u30e6\u30cb\u30fc\u30af\u306a\u3069\u306e\u5916\u90e8\u30ad\u30fc\u5236\u7d04\u306e\u8a2d\u5b9a\uff08Hasura\u306e\u30ea\u30ec\u30fc\u30b7\u30e7\u30f3\u3067\u306f\u5fc5\u9808\u306b\u306a\u308a\u307e\u3059\u3002\uff09 One to One\uff08Object [&hellip;]","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[151],"tags":[],"_links":{"self":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/18137"}],"collection":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=18137"}],"version-history":[{"count":11,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/18137\/revisions"}],"predecessor-version":[{"id":20062,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=\/wp\/v2\/posts\/18137\/revisions\/20062"}],"wp:attachment":[{"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=18137"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=18137"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.code-magagine.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=18137"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}