microsoft/power-platform-skills/audit-permissions
Claude Code and agent skill by microsoft/power-platform-skills
- vendor
Checking that the SKILL.md file is still in the repository.
Audits existing table permissions on a Power Pages site by analyzing them against site code and Dataverse metadata, then GRADES the configuration with deterministic 1–5 scores across 3 security/usability/correctness categories (9 dimensions). Detection is anchored by a recurring-issue catalog so findings and severities stay consistent run-to-run. Generates an HTML report with an at-a-glance verdict and per-category scores in the Overview plus a single list of **major/minor** issues (each major…
Install
npx vskill@latest install microsoft/power-platform-skills/audit-permissionsSKILL.md
The same SKILL.md was published earlier as microsoft/power-platform-skills/audit-permissions.
Plugin check: Runnode "${PLUGIN_ROOT}/scripts/check-version.js"— if it outputs a message, show it to the user before proceeding.
Audit Permissions
Audit existing table permissions on a Power Pages code site. Analyze permissions against the site code and Dataverse metadata, then generate a visual HTML report with deterministic 1–5 category scores, an advisory verdict, findings, reasoning, and suggested fixes.
The skill has two parts:
- Audit checks (evidence + remediation) — the per-table A–K checklist that compares every permission against real code usage and Dataverse metadata. It is the primary issue detector: it catches concrete, code-grounded problems (missing CRUD, append/appendto,
$expandgaps, broken parent chains, over-provisioned grants) and emits each as a major/minor issue with concrete evidence and a fix. - Scoring (reproducible result) — a 3-category rubric (9 dimensions) anchored by a recurring-issue catalog of fixed detection triggers + severities, followed by a single consolidation into root causes and one batched root-cause attribution pass for major issues. It turns the findings into pure-formula 1–5 category scores so two runs on the same configuration yield the same numbers.
Golden rule of scoring: you only ever find and label issues (major/minor). You do NOT invent the numeric score. The 1–5 numbers come from a fixed formula applied to the issue counts (see Appendix A). Same issue set ⇒ same score.
Site type routing
Before reading or executing the workflow below, perform the existing SPA project lookup first.
- Look for
powerpages.config.jsonin the current directory or immediate subdirectories using the
existing file-search patterns.
- If found, continue with the existing SPA workflow below.
- Only when that existing SPA lookup finds no
powerpages.config.json, run:
``bash node "${PLUGIN_ROOT}/scripts/lib/detect-project-context.js" ``
- If it returns
siteType: "non-spa", read and follow
${PLUGIN_ROOT}/skills/audit-permissions/references/non-spa-site-workflow.md. Do not execute the SPA workflow below.
- Otherwise, continue to Step 1 and preserve its existing not-found behavior.
Workflow
- Verify Site Deployment — Check that
.powerpages-sitefolder and table permissions exist - Gather Configuration — Read web roles, table permissions, site code, run the shared schema validator, and build the deterministic preflight cross-reference
- Analyze & Discover — Query Dataverse for relationships and lookup columns using deterministic scripts
- Run Audit Checks — Compare permissions against code usage and best practices (A–K checklist)
- Score the Configuration — Detect/label issues by the 3 categories using the recurring-issue catalog, consolidate to distinct root causes (major/minor), compute the 1–5 category scores and the verdict
- Root-cause attribution — In a single batched pass, label every major issue as permissions-only or caused by an upstream artifact, with a one-sentence justification shown in the report
- Generate Report — Create the HTML report (score overview + findings + inventory) and validate it
- Present Findings & Track — Summarize, record skill usage, and ask the user if they want to fix issues
Important: Do NOT ask the user questions during analysis. Autonomously gather all data, then present findings.
Audit completion telemetry
At the very start of Step 1, before site verification, initialize local run state:
Parse the JSON stdout and retain its auditRunId as <AUDIT_RUN_ID> for this invocation. The command does not emit a telemetry event; the existing generic skill invocation event is the start signal. The local run state provides the opaque random ID and start time needed for completion telemetry. Never derive the ID from, or replace it with, a site, environment, tenant, user, path, or report value.
Telemetry is best-effort and must never block the audit. If the initialization command fails or returns no auditRunId, continue the audit without completion telemetry. Do not invent an id and do not search local state for the latest run.
On every controlled terminal failure after a run id was returned, close the run before stopping:
Use exactly one of these fixed failure stages:
site_verificationconfiguration_gatheringschema_validationrelationship_discoveryaudit_checksscoringroot_cause_attributionreport_renderingreport_validationmetrics_validationunknown_controlled_failure
Do not pass error messages, paths, table names, finding content, or other user/site data to the telemetry script. A telemetry completion failure does not change the audit outcome and must not trigger a second completion attempt.
Task Tracking
At the start of Step 1, create all tasks upfront using TaskCreate. Mark each task in_progress when starting and completed when done.
| Task subject | activeForm | Description | |
|---|---|---|---|
| Verify site deployment | Verifying site deployment | Check .powerpages-site folder and table permissions exist | |
| Gather configuration | Gathering configuration | Read web roles, table permissions, site code; run validator; build preflight | |
| Discover relationships | Discovering relationships | Query Dataverse for lookup columns and relationships | |
| Run audit checks | Running audit checks | Create per-table tasks and run checklist (A–K) for each table, then cross-validate | |
| Score configuration | Scoring configuration | Detect/label by the 3 categories via the recurring-issue catalog, consolidate to root causes, compute 1–5 scores | |
| Root-cause attribution | Attributing root causes | Label every major issue permissions-only or upstream-caused in a single pass | |
| Generate report | Generating report | Create and validate the HTML report and display it in browser | |
| Present findings | Presenting findings | Summarize results, record usage, and offer to fix issues |
Note: The "Run audit checks" phase creates additional per-table tasks dynamically in Step 4.2. These per-table tasks track the systematic A–K checklist for each table independently.
Step 1: Verify Site Deployment
Use Glob to find:
**/powerpages.config.json— identifies the project root**/.powerpages-site/table-permissions/*.tablepermission.yml— existing permissions
If no .powerpages-site folder exists, stop and tell the user to deploy first using /deploy-site. If no table permissions exist, note this as a critical finding (the site may have no data access configured) and continue the audit — there may still be code references that need permissions.
Before stopping because .powerpages-site is absent, close completion telemetry with failureStage: site_verification as described above.
Step 2: Gather Configuration
Single-pass performance contract
Gather all local evidence in one bounded pass before making judgments:
- Read web roles, table permissions, site settings, and
.datamodel-manifest.jsonin grouped operations. - Scan source files once for API operations, entity sets, selects, filters, lookups, expands, uploads, routes, imports, and feature/auth gates. Prefer one grouped search plus targeted reads of only the matching regions; never read an entire source tree file-by-file.
- Locate the permission plan once. Extract all authorization-relevant statements in one operation into
planClaims; do not reopen or re-extract the plan later. - Freeze these facts in
audit-evidence.json. Steps 4–6 consume only this ledger plus any gated Dataverse results.
Do not rescan source code or the plan to gain confidence. A second read is allowed only when a specific ledger field is missing and the exact file/region needed is known. Record the added evidence once, then continue. Never perform multiple searches for differently worded versions of the same plan claim.
2.1 Read Web Roles
Read all files matching **/.powerpages-site/web-roles/*.yml. Keys may carry a publisher prefix — try mspp_<key>, then adx_<key>, then the bare <key> (first found wins). Extract id, name, anonymoususersrole, authenticatedusersrole from each. If YAML fails to parse or its root isn't an object, record a parse error (feeds preflight IS).
2.2 Read Table Permissions
Read all files matching **/.powerpages-site/table-permissions/*.tablepermission.yml. Using the same prefix rule, for each permission extract:
entityname(permission name)entitylogicalname(table)scope(numeric code) → map to a label:756150000 = Global,756150001 = Contact,756150002 = Account,756150003 = Parent,756150004 = Self; anything else →Unknown(<code>); missing → scope-1, labelUnknownread,create,write,delete,append,appendto(boolean flags)adx_entitypermission_webrole(array of web role UUIDs) → resolve each GUID to a role name via §2.1; unresolved → mark<unresolved:…>contactrelationship,accountrelationship(if Contact/Account scope)parententitypermission,parentrelationship(if parent scope)
Record a parse error on failure (feeds preflight IS).
2.3 Analyze Site Code
In the single source pass, search the site source code for:
- Web API calls (
/_api/) - Lookup bindings (
@odata.bind) - File uploads (
uploadFileColumn,uploadFile,upload*Photo,upload*Image) $expandusage ($expand,buildExpandClause,ExpandOption)
Also check for .datamodel-manifest.json in the project root for the authoritative table list. It has { environmentUrl?, tables: [{ logicalName, displayName, status?, columns: [{ logicalName, type }] }] }. If missing or tables isn't an array, treat the data model as absent.
Additionally scan Web API artifacts (used by the root-cause attribution in Step 6 — best-effort):
- Central client: present if any of
src/shared/powerPagesApi.ts(x)orsrc/lib/powerPagesApi.tsexists. - Service files under
src/shared/services/**(.ts/.tsx/.js/.jsx): record which data-model table logical names and which HTTP methods (GET/POST/PATCH/PUT/DELETE) appear in each. - Wildcard column selects: record every occurrence of
$select=*(or a$selectwhose value is*) in any scanned source file, together with its file path and the table being queried. - Type files under
src/types/**: extract property names of the firstinterface/typeliteral; infer the table from filename/content when possible. - Web API site settings in
.powerpages-site/site-settings/(files namedWebapi-*/Webapi/*): parsename+value. Splitnameon/:Webapi/<entitySet>/enabled→ kindenabled;.../fields→ kindfields;Webapi/error→error; elseother.webapiEnabledEntitySets= entity sets whoseenabledvalue is exactly"true". For everyfieldssetting also record `isWildcard` — true when the trimmed value is*, or when any comma-separated entry is*. A list that names column logical names is NOT a wildcard, however long it is.
This is the start of the file. Read the full SKILL.md on GitHub.
Security
- Security scanPassed, 100 of 100Pattern checks on the skill's files. Certified 25 Nov 2026.
- Model reviewPassed
Quality evaluation
- Task evaluationNot runNo evaluation yet. Run one in Skill Studio.
Source
- SKILL.md in the repositoryCheckingplugins/power-pages/skills/audit-permissions/SKILL.md
Popularity
- Repository stars
- 1,097
- Repository forks
- 222
- 7-day trend score
- 34
Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 20 Mar 2026, 8 months ago.
Works with
Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.
- Claude Code
- Cursor
- GitHub Copilot
- Windsurf
- Codex
- Gemini CLI
- Cline
- Amp
- Roo Code
- Goose
- Continue
- Kilo Code
- Junie
- Trae
- OpenHands
- Qwen Code
- AI Agent
- Tabnine Chat
- Sourcegraph Cody
- Amazon Q
- Firebase Genkit
- Sweep
- Devin
- Phind
- Mentat
- Claude Desktop
- Aider
- GPT Pilot
- Plandex
- bolt.new
- v0
- Replit Agent
- Anse
- TypingMind
- BetterChatGPT
- LibreChat
- Warp AI
- Pieces
- Fig AI
Embed badge
[](https://verified-skill.com/skills/microsoft/power-platform-skills/audit-permissions)