{"templateId":"markdown","sharedDataIds":{"sidebar":"sidebar-@l10n/ja/sidebars.yaml"},"props":{"metadata":{"markdoc":{"tagList":[]},"type":"markdown"},"seo":{"title":"APIを使用したポリシーベースのデータベース権限の設定","description":"APIを使用してユーザーに特定のデータベースアクセス権限を付与","siteUrl":"https://docs.treasure.ai","lang":"en-US","jsonLd":{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://www.treasure.ai/","name":"Treasure AI","url":"https://www.treasure.ai/","logo":"https://www.treasure.ai/hubfs/assets/images/logos/primary-logo.svg"},{"@type":"WebSite","@id":"https://docs.treasure.ai/#website","name":"Treasure AI Documentation","url":"https://docs.treasure.ai/","inLanguage":["en","ja"],"publisher":{"@id":"https://www.treasure.ai/"}}]},"llmstxt":{"hide":false,"sections":[{"title":"Table of contents","includeFiles":["**/*"],"excludeFiles":[]}],"excludeFiles":[]}},"dynamicMarkdocComponents":[],"compilationErrors":[],"ast":{"$$mdtype":"Tag","name":"article","attributes":{},"children":[{"$$mdtype":"Tag","name":"Heading","attributes":{"level":1,"id":"apiを使用したポリシーベースのデータベース権限の設定","__idx":0},"children":["APIを使用したポリシーベースのデータベース権限の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["APIを使用してデータベース権限を設定し、個々のユーザーに特定のデータベースへのアクセスを許可できます。"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["各アカウントで、以下の権限を使用してデータベースへのユーザーアクセスを設定できます："]},{"$$mdtype":"Tag","name":"div","attributes":{"className":"md-table-wrapper"},"children":[{"$$mdtype":"Tag","name":"table","attributes":{"className":"md"},"children":[{"$$mdtype":"Tag","name":"thead","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"権限"},"children":["権限"]},{"$$mdtype":"Tag","name":"th","attributes":{"data-label":"説明"},"children":["説明"]}]}]},{"$$mdtype":"Tag","name":"tbody","attributes":{},"children":[{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Manage"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ユーザーはowner_manage、download、edit、query、importを含むすべての権限を持ち、アカウント内のデータベースに対してあらゆる操作を実行できます。（Treasure コンソールでは_Full Access_カテゴリに表示されます）"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Download"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ユーザーは指定されたデータベースをダウンロードする権限を持ちます。（Treasure コンソールでは_Limited Access_カテゴリにのみ表示されます）"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Owner_Manage"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ユーザーは自分のデータベースを管理できます。（Treasure コンソールでは_Limited Access_カテゴリの_Manage Own Database_として表示されます）"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Import"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ユーザーはアカウント内の任意のデータベースに対してインポートジョブを実行できます。（Treasure コンソールでは_Import Only_として表示されます）"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Query"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ユーザーはアカウント内の任意のデータベースを表示し、クエリを実行できます。（Treasure コンソールでは_Query Only_として表示されます）"]}]},{"$$mdtype":"Tag","name":"tr","attributes":{},"children":[{"$$mdtype":"Tag","name":"td","attributes":{},"children":["Edit"]},{"$$mdtype":"Tag","name":"td","attributes":{},"children":["ユーザーは指定されたアカウントに対する編集権限を持ちます。（Treasure コンソールでは_General Access_として表示されます）"]}]}]}]}]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["詳細は",{"$$mdtype":"Tag","name":"MarkdownLink","attributes":{"href":"/products/control-panel/security/policies/about-policy-based-database-permissions"},"children":["ポリシーベースのデータベース権限について"]},"をご覧ください。"]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"データベース管理権限の設定","__idx":1},"children":["データベース管理権限の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["manage権限を使用して、ユーザーにデータベースへのフルアクセスを付与できます。これにより、owner_manage、download、edit、query、importを含むすべての権限に加えて、アカウント内のデータベースに対するあらゆる操作を実行する権限がユーザーに付与されます。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ curl --location --request PATCH \\\n'https://api.treasuredata.com/v3/access_control/policies/<policy_id>/permissions' \\\n--header 'Authorization: TD1 <api_key>' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\"Databases\": [{\"operation\": \"manage\"}]}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"データベースダウンロード権限の設定","__idx":2},"children":["データベースダウンロード権限の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ユーザーのデータベースアクセスをdownloadに設定し、指定されたデータベースをダウンロードする権限を付与します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"$ curl 'https://{{host}}/v3/access_control/policies/{{policy_id}}/permissions' \\\n-X 'PATCH' \\\n--data-raw '{\"Databases\":[{\"operation\":\"download\"}]}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"データベースowner_manage権限の設定","__idx":3},"children":["データベースOwner_Manage権限の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ユーザーのデータベースアクセスをowner_manageに設定し、自分のデータベースを管理する権限を付与します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl 'https://{{host}}/v3/access_control/policies/{{policy_id}}/permissions' \\\n-X 'PATCH' \\\n--data-raw '{\"Databases\":[{\"operation\":\"owner_manage\"}]}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"データベースインポート権限の設定","__idx":4},"children":["データベースインポート権限の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ユーザーのデータベースアクセスをimportに設定し、アカウント内のデータベースに対してデータインポートジョブを実行する権限を付与します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --location --request PATCH 'https://api.treasuredata.com/v3/access_control/policies/<policy_id>/permissions' \\\n--header 'Authorization: TD1 <api_key>' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"Databases\": [\n        {\"operation\": \"import\", \"ids\": <db_id>}\n    ]\n}\n'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"データベースクエリ権限の設定","__idx":5},"children":["データベースクエリ権限の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ユーザーのデータベースアクセスをqueryに設定し、アカウント内の特定のデータベースを表示してクエリを実行する権限を付与します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --location --request PATCH 'https://api.treasuredata.com/v3/access_control/policies/<policy_id>/permissions' \\\n--header 'Authorization: TD1 <api_key>' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"Databases\": [\n        {\"operation\": \"query\", \"ids\": <db_id>}\n    ]\n}\n'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"データベース編集権限の設定","__idx":6},"children":["データベース編集権限の設定"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["ユーザーのデータベース権限をeditに設定し、アカウント内のデータベースを編集する権限を付与します。"]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --location --request PATCH 'https://api.treasuredata.com/v3/access_control/policies/<policy_id>/permissions' \\\n--header 'Authorization: TD1 <api_key>' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"Databases\": [\n        {\"operation\": \"edit\", \"ids\": <db_id>}\n    ]\n}'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"Heading","attributes":{"level":2,"id":"apiを使用したデータベースポリシーの更新","__idx":7},"children":["APIを使用したデータベースポリシーの更新"]},{"$$mdtype":"Tag","name":"p","attributes":{},"children":["以下の呼び出しを行うことで、データベースポリシーを更新できます。"]},{"$$mdtype":"Tag","name":"ol","attributes":{},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["ポリシーIDを使用して、更新したいポリシーを取得します。例えば、ポリシーの現在の権限を表示できます：database(10)への_manage_、",{"$$mdtype":"Tag","name":"em","attributes":{},"children":["edit"]},"、database(1,2,3)への_query_、database(5,4)への_import_。"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --location --request GET 'https://api.treasuredata.com/v3/access_control/policies/<policy_id>/permissions' \\\n--header 'Authorization: TD1 <api_key>'\n","lang":"bash"},"children":[]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"json","header":{"controls":{"copy":{}}},"source":" {\n  \"Databases\": [\n    {\"operation\":\"manage\"},\n\t\t{\"operation\": \"edit\", \"ids\": \"10\"},\n    {\"operation\": \"query\", \"ids\": \"1,2,3\"},\n    {\"operation\": \"import\", \"ids\": \"5,4\"}\n  ]\n}\n","lang":"json"},"children":[]},{"$$mdtype":"Tag","name":"ol","attributes":{"start":2},"children":[{"$$mdtype":"Tag","name":"li","attributes":{},"children":["PATCHを使用して、権限を_manage_、database(1,3)への_query_、database(2,5,6)への_import_のように更新できます。"]}]},{"$$mdtype":"Tag","name":"CodeBlock","attributes":{"data-language":"bash","header":{"controls":{"copy":{}}},"source":"curl --location --request PATCH 'https://api.treasuredata.com/v3/access_control/policies/<policy_id>/permissions' \\\n--header 'Authorization: TD1 <api_key>' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n    \"Databases\": [\n         {\"operation\": \"manage\"},\n         {\"operation\": \"query\", \"ids\": \"1,3\"},\n         {\"operation\": \"import\", \"ids\": \"2,5,6\"}\n    ]\n}'\n","lang":"bash"},"children":[]}]},"headings":[{"value":"APIを使用したポリシーベースのデータベース権限の設定","id":"apiを使用したポリシーベースのデータベース権限の設定","depth":1},{"value":"データベース管理権限の設定","id":"データベース管理権限の設定","depth":2},{"value":"データベースダウンロード権限の設定","id":"データベースダウンロード権限の設定","depth":2},{"value":"データベースOwner_Manage権限の設定","id":"データベースowner_manage権限の設定","depth":2},{"value":"データベースインポート権限の設定","id":"データベースインポート権限の設定","depth":2},{"value":"データベースクエリ権限の設定","id":"データベースクエリ権限の設定","depth":2},{"value":"データベース編集権限の設定","id":"データベース編集権限の設定","depth":2},{"value":"APIを使用したデータベースポリシーの更新","id":"apiを使用したデータベースポリシーの更新","depth":2}],"frontmatter":{"seo":{"title":"APIを使用したポリシーベースのデータベース権限の設定","description":"APIを使用してユーザーに特定のデータベースアクセス権限を付与"}},"lastModified":"2026-06-01T09:34:27.000Z","pagePropGetterError":{"message":"","name":""}},"slug":"/ja/products/control-panel/security/policies/setting-policy-based-database-permissions-using-the-api","userData":{"isAuthenticated":false,"teams":["anonymous"]},"isPublic":true}