[OneDev #38] sharepoint-external-sharing-report: filter out stale siteusers entries #1

Open
opened 2026-05-24 04:46:35 +00:00 by joseph · 0 comments
Owner

Imported from OneDev issue #38 (id 35590)
Original project: internal-joseph
Original state: Open
Original submitterId: 5
Original submitDate: 2026-05-08T19:33:22.516+00:00
Original lastActivity: {'date': '2026-05-08T19:33:22.516+00:00', 'description': 'opened', 'userId': 5}

Original fields:

  • Type: New Feature
  • Priority: Normal
  • Assignees: None

Problem

HSC's external sharing report listed Ami Cheek with "web-only limited access" on the /Board subsite even though she has zero actual permissions there:

  • No role assignment (direct or group)
  • No items with broken inheritance
  • No active sharing link

She appeared because SharePoint's siteusers collection is sticky — once a user is referenced anywhere on a site (old sharing link, file metadata Created/Modified By, prior group membership), they stay in siteusers permanently. The report (or whatever path produced the entry Barbara saw) treats that as "has access."

Barbara reasonably read this as "Ami can see Board files" and asked me to remove access that doesn't exist.

Fix

sp_report_v2.py should not include any user as a finding unless the user has an actual current permission grant. Concretely:

  1. For each candidate user, verify there's at least one role assignment on the site/list/item via /web/getUserEffectivePermissions returning non-zero High|Low, OR
  2. The user appears in a current roleassignments expansion (not just siteusers).

If neither, drop them from the output.

Done-when

Re-running the HSC report does NOT list Ami Cheek (or anyone else with effectivePermissions == 0).

Reference

  • Skill: internal-joseph/skills/sharepoint-external-sharing-report/sp_report_v2.py
  • Triggering session: HSC permissions cleanup, 2026-05-08, Barbara Johnson principal notes
  • SharePoint REST: /_api/web/getUserEffectivePermissions(@user)?@user='i:0%23.f|membership|<upn>' returns {High, Low} — both 0 = no real access.
Imported from OneDev issue #38 (id 35590) Original project: internal-joseph Original state: Open Original submitterId: 5 Original submitDate: 2026-05-08T19:33:22.516+00:00 Original lastActivity: {'date': '2026-05-08T19:33:22.516+00:00', 'description': 'opened', 'userId': 5} Original fields: - Type: New Feature - Priority: Normal - Assignees: None ## Problem HSC's external sharing report listed Ami Cheek with "web-only limited access" on the `/Board` subsite even though she has zero actual permissions there: - No role assignment (direct or group) - No items with broken inheritance - No active sharing link She appeared because SharePoint's `siteusers` collection is sticky — once a user is referenced anywhere on a site (old sharing link, file metadata Created/Modified By, prior group membership), they stay in `siteusers` permanently. The report (or whatever path produced the entry Barbara saw) treats that as "has access." Barbara reasonably read this as "Ami can see Board files" and asked me to remove access that doesn't exist. ## Fix `sp_report_v2.py` should not include any user as a finding unless the user has an actual current permission grant. Concretely: 1. For each candidate user, verify there's at least one role assignment on the site/list/item via `/web/getUserEffectivePermissions` returning non-zero High|Low, OR 2. The user appears in a current `roleassignments` expansion (not just siteusers). If neither, drop them from the output. ## Done-when Re-running the HSC report does NOT list Ami Cheek (or anyone else with `effectivePermissions == 0`). ## Reference - Skill: `internal-joseph/skills/sharepoint-external-sharing-report/sp_report_v2.py` - Triggering session: HSC permissions cleanup, 2026-05-08, Barbara Johnson principal notes - SharePoint REST: `/_api/web/getUserEffectivePermissions(@user)?@user='i:0%23.f|membership|<upn>'` returns `{High, Low}` — both 0 = no real access.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
joseph/internal-joseph#1
No description provided.