• Projects
  • Service
  • About
  • branding.bz
  • Podcast
  • Tips
  • FAQ
  • Recruit
  • Download
  • Contact
  • branding.bz(ブランド構築SaaS)
  • DESIGN NOW(デザインメディア)
  • X
  • LinkedIn
  • Spotify
  • Facebook

213-0011 神奈川県川崎市高津区久本3-6-7-303

© 2026 ID INC. All rights reserved

claude-skills/スキル
SKILLOfficialdatabase

dv-security

プラグイン
dataverse
ソース
GitHub で見る ↗
説明

Dataverse(データを一元管理するプラットフォーム)環境における、セキュリティロール(アクセス権限の設定)の割り当て、ユーザーアクセス、アプリケーションユーザー、事業部門、および管理者権限の委譲に対応します。 次のような場合に使用: ユーザーに対してアクセス権を付与したい、ロール(権限の種類)を与えたい、自分が管理者になりたい、またはサービスプリンシパル(プログラムが動作するための専用アカウント)を追加したいとき。

原文を表示

Security-role assignment, user access, application users, business units, and admin self-elevation in Dataverse environments. Use when the user wants to give someone access, grant a role, become an admin, or add a service principal.

ユースケース
  • ユーザーにアクセス権を付与したいとき
  • ロール(権限の種類)を与えたいとき
  • 管理者権限を委譲したいとき
  • サービスプリンシパルを追加したいとき
本文(日本語訳)

スキル: セキュリティ — ロール割り当てと自己昇格

このスキルは公式のCLIを使用します — ロール変更にはPAC CLI、検証にはDataverse CLIを使用します。ロール操作用のPythonスクリプトは作成しないでください。

実行前にプレビューを表示

ロール付与と自己昇格は重大な変更です(セキュリティ設定を変更し、Purview(監査ログ)に記録されます)。実行前に、対象ユーザー・ロール・環境といった内容を平文で説明し、不明な部分はプレースホルダー(<ENV_URL>、<USER_EMAIL>)で示した上で、確認と不足情報の入力を同じターンで求めてください。生のpac adminコマンドは表示せず、ユーザーがCLI構文を読まなくてもセキュリティ変更の内容を判断できるようにしましょう。

基本原則: ユーザーが最初のやり取りで起こることを評価できなければいけません。「どの環境を対象にしますか?」という一行の質問では不十分です。「user@contoso.comに対して<ENV_URL>のシステム管理者ロールを割り当てます。続行を確認し、対象環境のURLを入力してください(または、「すべて」と入力してリストを表示し、一括実行します)」という説明なら適切です。

例

ロール割り当て(ユーザーは指定されているが環境が不明):

  • ❌ 「どの環境を対象にしますか?」
  • ✅ 「user@contoso.comに対して<ENV_URL>のシステム管理者ロールを割り当てます。続行を確認し、対象環境のURLを入力してください(または、「すべて」と入力してリストを表示し、一括実行します)。」

すべての環境でのパワーユーザーアクセス:

  • ❌ 「メールアドレスを入力してください。」
  • ✅ 「あなたの環境をリストアップし、<YOUR_UPN>に対して各環境で並行してシステム管理者を割り当てます。環境によってassign-userが失敗した場合は、その環境では自己昇格にフォールバック(Purviewに記録)します。続行を確認し、あなたのUPN(ユーザープリンシパルネーム)を入力してください。」

スキルの適用範囲

必要な操作 代わりに使用するスキル
テーブル、列、リレーションシップの作成または変更 dv-metadata
組織設定、監査、一括削除、保持ポリシーの管理 dv-admin
レコードの照会または読み取り dv-query
レコードの作成、更新、削除 dv-data
テナントレベルのガバナンス(DLP、環境ライフサイクル) pac admin --help

前提条件

  • PAC CLIがインストール・認証済み(pac auth createを実行済み)
  • 対象環境のシステム管理者ロール、または自己昇格の場合はグローバル管理者・Power Platform管理者・Dynamics 365管理者
  • アクティブな認証プロファイル:pac auth listで確認
  • ヘッドレス/通信制限ホスト: SDKでロール・ユーザー・業務単位の操作を処理。PAC CLIのみの操作にはサービスプリンシパルを使用。python scripts/auth.py --checkで通信を確認してください。詳細はdv-connect/references/headless-hosts.mdを参照。

ユーザーにセキュリティロールを割り当てる

pac admin assign-user --user <email-or-object-id> --role "System Administrator" --environment <url>

引数

引数 別名 必須 説明
--user -u はい ユーザーのメールアドレス(UPN)またはAzure AD オブジェクトID
--role -r はい セキュリティロール名(例:System Administrator、Basic User)
--environment -env はい 対象環境のURLまたはID
--application-user -au いいえ ユーザーをアプリケーションユーザー(サービスプリンシパル)として扱う
--business-unit -bu いいえ 業務単位ID。デフォルトは実行者の業務単位

割り当てを検証する — 終了コード0は成功の証拠ではありません

pac admin assign-userは失敗時でも終了コード0で終了します(環境が見つからない、ロール名が不正、ユーザーが不明な場合も)。クリーンな終了を成功と見なさないでください。

  1. 終了コードではなく、出力を読む。 失敗時でも終了コード0ですが、エラーメッセージが出力されます(「環境が見つかりません」「ロールが存在しません」など)。出力にエラーが含まれていれば停止してください。

  2. 使用した--environmentと正確に照合する。 再解決や短縮形を使わず、異なるIDは間違った組織で何もせず「成功」と見なされる可能性があります。Dataverse CLIの読み取りでユーザーのロールをクエリしてください:

# ユーザーのsystemuseridを解決し、割り当てられたロールをリストアップします。
# --contextはマネージドCLI呼び出しに対するプラグイン/スキル/エージェント属性を含みます。
dataverse api request --target dataverse --method GET \
  --path "/api/data/v9.2/systemusers?%24select=systemuserid&%24filter=internalemailaddress eq 'user@contoso.com'" \
  --environment <same-url-as-assign> \
  --context "app=dataverse-skills/<ver>;skill=dv-security;agent=<agent>"
dataverse api request --target dataverse --method GET \
  --path "/api/data/v9.2/systemusers(<systemuserid>)/systemuserroles_association?%24select=name" \
  --environment <same-url-as-assign> \
  --context "app=dataverse-skills/<ver>;skill=dv-security;agent=<agent>"

最初のクエリが行を返さない場合、サインイン ID はdomainname(AAD UPN)ではなくinternalemailaddress(メイン メール アドレス)に存在する可能性があります。%24filter=domainname eq '<upn>'または オブジェクト IDで割り当てた場合はazureactivedirectoryobjectid eq '<objectid>'で再試行してください。行が見つからないこと自体は、付与が失敗したことの証拠ではありません。

対象ロールが存在しない場合、割り当てが完了していません。再実行して出力を確認するか、自己昇格にフォールバックしてください。


バッチワークフロー:複数環境にロールを割り当てる

並行実行します。順序実行は行わないでください:

ステップ 1: pac admin list                                           → すべての環境を取得
ステップ 2: 必要に応じてタイプでフィルタ(例:開発環境、サンドボックス) → 対象を特定
ステップ 3: ユーザーに確認 — 対象環境のリストを表示
ステップ 4: すべての割り当てを1つのbashコマンドで実行:
pac admin assign-user --user user@contoso.com --role "System Administrator" --environment https://dev1.crm.dynamics.com &
pac admin assign-user --user user@contoso.com --role "System Administrator" --environment https://dev2.crm.dynamics.com &
pac admin assign-user --user user@contoso.com --role "System Administrator" --environment https://dev3.crm.dynamics.com &
wait
ステップ 5: 各環境での割り当てを検証し、レポート(「3/3環境で割り当てと検証が完了」など)

重要: ロール割り当ての前に対象となる環境をユーザーに確認し、各割り当てが成功したことを検証してください。クリーンな終了コードは成功を証明しません。


テナント管理者の自己昇格(フォールバック)

自己昇格は、他のユーザーへのロール割り当てとは大きく異なります。 pac admin assign-user <other>は他のユーザーに権限を付与し、pac admin self-elevateは呼び出し元に権限を付与します。リスク評価と監査対象は異なるため、確認プロトコルはより厳格です。

pac admin assign-userが「ユーザーにロールが割り当てられていません」というエラーで失敗した場合は、以下を使用します:

pac admin self-elevate --environment https://myorg.crm.dynamics.com
  • グローバル管理者、Power Platform管理者、またはDynamics 365管理者が必須
  • すべての昇格はMicrosoft Purviewに記録されます
  • --environmentが省略された場合、アクティブな認証プロファイルを使用

自己昇格の確認プロトコル(assign-userより厳格)

pac admin self-elevateを実行する前に、エージェントは以下を必ず実行してください:

  1. リスクを明示的に述べる。 実行前の説明に以下のような文言(または同等の内容)を含めてください:

    「このコマンドはあなた自身に<env>のシステム管理者を付与します。この操作はMicrosoft Purviewにあなたの身元とタイムスタンプとともに記録されます。」

  2. 実施理由をキャプチャする。 チケットID、インシデント番号、または「開発用サンドボックスアクセス — チケットなし」のような自由形式のメモなど、1行の理由を求めてください。実行前の説明で理由をユーザーに返してください。

  3. リスク説明と理由の両方がユーザーに表示された後、明示的な確認を待つ。 ユーザーが(1)と(2)を見る前の単なる「はい」は受け入れないでください。

  4. 暗黙のフォールバックは行わない。 pac admin assign-userが失敗した場合、まずその失敗を表示し、その後このプロトコルを使用してself-elevateを提案してください。自動チェーンは行わないでください。

フロー: 常にpac admin assign-userを最初に試みます。admin self-elevateは文書化されたフォールバックであり、上記のプロトコルで制御されます。

CLIフォールバック: pac admin self-elevateがエラーで終了した場合、Power Platform Admin Center → 環境を選択 → アクセス → システム管理者ロールで手動昇格してください。すべての昇格は依然としてPurviewに記録されます。(PAC CLI 2.6.4では、CLIが空のapi-version=をバックエンドに送信するため、bolt.authentication.http.AuthenticatedClientException / ApiVersionInvalidでコマンドが失敗します。)


セーフティルール

  • システム管理者ロール割り当ては常に確認してください
  • バッチ操作の前に対象環境のリストを表示してください
  • 自己昇格はログと監査の対象です — ユーザーに警告してください
原文(English)を表示

Skill: Security — Role Assignment and Self-Elevation

This skill uses first-party CLIs — PAC CLI for role changes, Dataverse CLI to verify. Do NOT write Python scripts for role operations.

Preview Before Running

Role grants and self-elevate are destructive (they change security posture and are logged to Purview). Before running, preview the action in plain prose — target user, role, environment(s) — using placeholders (<ENV_URL>, <USER_EMAIL>) for anything unknown, and ask for confirmation and missing values in the same turn. Skip the raw pac admin block; the user shouldn't have to read CLI syntax to approve a security change.

Key principle: the user should be able to evaluate what's about to happen from your first response. A bare "which environment?" fails that test; a one-line prose preview passes it.

Examples

Assign role (user given, env missing):

  • ❌ "Which environment should I target?"
  • ✅ "I'll assign System Administrator to user@contoso.com on <ENV_URL>. Confirm to proceed and provide the target environment URL (or 'all' to list and batch)."

Admin access across all environments:

  • ❌ "Please provide your email address."
  • ✅ "I'll list your environments, then assign System Administrator in parallel on each one for <YOUR_UPN>. If assign-user fails on any environment, I'll fall back to self-elevate (logged to Purview) for that one. Confirm to proceed and provide your UPN."

Skill boundaries

Need Use instead
Create or modify tables, columns, relationships dv-metadata
Manage org settings, audit, bulk delete, retention dv-admin
Query or read records dv-query
Write, update, or delete records dv-data
Tenant-level governance (DLP, env lifecycle) pac admin --help

Prerequisites

  • PAC CLI installed and authenticated (pac auth create)
  • System Administrator role in target environment (or Global/PP/D365 Admin for self-elevate)
  • Active auth profile: pac auth list
  • Headless / restricted-egress hosts: SDK handles role / user / business-unit ops; service principal for PAC-only ops; verify egress with python scripts/auth.py --check. See dv-connect/references/headless-hosts.md.

Assign a Security Role to a User

pac admin assign-user --user <email-or-object-id> --role "System Administrator" --environment <url>

Arguments

Argument Alias Required Description
--user -u Yes User email (UPN) or Azure AD object ID
--role -r Yes Security role name (e.g., System Administrator, Basic User)
--environment -env Yes Target environment URL or ID
--application-user -au No Treat user as an application user (service principal)
--business-unit -bu No Business unit ID. Defaults to the caller's business unit

Verify the assignment — exit code 0 is not proof

pac admin assign-user exits 0 even when it fails (unresolved environment, wrong role name, unknown user). Never treat a clean exit as success.

  1. Read the output, not just the exit code. A failed run still exits 0 but prints an error (environment ... not found, role ... does not exist). Stop if the output contains an error.
  2. Confirm against the exact --environment you used — do not re-resolve or shorten it; a different id silently "succeeds" on the wrong org. Query the user's roles with a Dataverse CLI read:
# Resolve the user's systemuserid, then list their assigned roles.
# --context carries plugin/skill/agent attribution on the managed CLI call.
dataverse api request --target dataverse --method GET \
  --path "/api/data/v9.2/systemusers?%24select=systemuserid&%24filter=internalemailaddress eq 'user@contoso.com'" \
  --environment <same-url-as-assign> \
  --context "app=dataverse-skills/<ver>;skill=dv-security;agent=<agent>"
dataverse api request --target dataverse --method GET \
  --path "/api/data/v9.2/systemusers(<systemuserid>)/systemuserroles_association?%24select=name" \
  --environment <same-url-as-assign> \
  --context "app=dataverse-skills/<ver>;skill=dv-security;agent=<agent>"

If the first query returns no row, the sign-in identity may live on domainname (the AAD UPN) rather than internalemailaddress (Primary Email) — retry with %24filter=domainname eq '<upn>', or azureactivedirectoryobjectid eq '<objectid>' when you assigned by object id. A missing row is not proof the grant failed.

If the target role is absent, the assignment did not take — re-run, read the output, or fall back to self-elevate.


Batch Workflow: Assign Role Across Multiple Environments

Run in parallel — never sequentially:

Step 1: pac admin list                                              -> Get all environments
Step 2: Filter by type if needed (e.g., Developer, Sandbox)        -> Identify targets
Step 3: Confirm with user — show list of target environments
Step 4: Run ALL assignments in a single bash call:
pac admin assign-user --user user@contoso.com --role "System Administrator" --environment https://dev1.crm.dynamics.com &
pac admin assign-user --user user@contoso.com --role "System Administrator" --environment https://dev2.crm.dynamics.com &
pac admin assign-user --user user@contoso.com --role "System Administrator" --environment https://dev3.crm.dynamics.com &
wait
Step 5: Verify each landed (exit 0 is not proof — see above), then report ("Assigned + verified on 3/3 environments")

Important: Always confirm which environments will be affected before assigning roles, and verify each assignment landed — a clean exit code does not prove success.


Tenant Admin Self-Elevation (Fallback)

Self-elevation is materially different from assigning a role to another user. pac admin assign-user <other> grants privilege to someone else; pac admin self-elevate grants privilege to the caller. The risk profile and audit posture are different, so the confirmation protocol is stricter.

If pac admin assign-user fails with "user has not been assigned any roles", use:

pac admin self-elevate --environment https://myorg.crm.dynamics.com
  • Requires Global Admin, Power Platform Admin, or Dynamics 365 Admin
  • All elevations are logged to Microsoft Purview
  • Uses the active auth profile if --environment is omitted

Self-elevation confirmation protocol (stricter than assign-user)

Before running pac admin self-elevate, the agent MUST:

  1. State the risk explicitly. Include this wording (or equivalent) in the pre-run summary:

    "This grants YOU System Administrator on <env>. The action is logged to Microsoft Purview with your identity and timestamp."

  2. Capture a reason. Ask for a one-line reason — ticket ID, incident number, or a free-form note such as "dev sandbox access — no ticket". Echo the reason back in the pre-run summary so the user sees what will be on the record.
  3. Wait for an explicit confirmation AFTER the user has seen both (1) and (2). Do NOT accept a bare "yes" given before the risk statement and reason are on screen.
  4. Do NOT silently fall back. If pac admin assign-user fails, surface the failure first, then offer self-elevate with this protocol — never chain them automatically.

Flow: Always try pac admin assign-user first. admin self-elevate is the documented fallback, gated by the protocol above.

CLI fallback: If pac admin self-elevate errors out, self-elevate manually via Power Platform Admin Center → select the environment → Access → System Administrator role. All elevations are still logged to Purview. (In PAC CLI 2.6.4 the command fails with bolt.authentication.http.AuthenticatedClientException / ApiVersionInvalid because the CLI sends an empty api-version= to the backend.)


Safety Rules

  • Always confirm before assigning System Administrator role
  • Show the list of target environments before batch operations
  • Self-elevation is logged and auditable — warn the user

原文・著作権は Anthropic および各プラグイン作者に帰属します。日本語訳は Claude API による自動翻訳です。