# Admin Endpoint Role Guard

> Probe every administrative operation with a non-admin account and confirm the refusal is a 403 from the server, not missing UI. Use when the product has staff, backoffice or platform-admin operations that normal members must never reach

- Skill: `wsh7ash/admin-endpoint-role-guard` (Agent Skill)
- Install (CLI): `npx get-skill add wsh7ash/admin-endpoint-role-guard`
- Raw SKILL.md: https://api.skillmd.com/api/skills/wsh7ash/admin-endpoint-role-guard/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: Wsh7Ash (https://skillmd.com/u/wsh7ash)
- Updated: 2026-11-22
- Page: https://skillmd.com/skills/wsh7ash/admin-endpoint-role-guard

---


# Admin Endpoint Role Guard

> Probe every administrative operation with a non-admin account and confirm the refusal is a 403 from the server, not missing UI

**Use when:** the product has staff, backoffice or platform-admin operations that normal members must never reach

**Avoid when:** you have no admin or member role pair available and cannot compare both sides of the guard

## Procedure

1. Enumerate administrative operations from clients, route tables and description documents, including staff-only paths.
2. Send each operation with a plain member credential from your own second account and record the outcome.
3. Confirm the guard covers every HTTP method, not only GET, since DELETE and POST frequently have separate handlers.
4. Check for client-side-only protection by replaying requests taken straight from the admin UI without the UI in between.
5. Look for data returned in error paths, where a failed check may still echo records before refusing.
6. Record the enforcement point for each guarded endpoint so reviewers can rate the consistency of the design.

## Signals

- A member credential receives complete admin data even though no admin link exists anywhere in the member UI.
- GET refuses with 403 while POST to the same path mutates state in some way the member should never trigger.
- An error response contains counts, names or identifiers that the refused list endpoint should never have touched.
- Admin behavior varies by prefix, so v2 routes guard properly while legacy v1 paths accept the member token.

## Patterns

**1. Method sweep**

```text
GET    /api/staff/orders member -> 403
POST   /api/staff/orders member -> 200  -> guard is per-method
```

**2. Replay probe**

```text
copy admin UI request, swap session for member cookie -> record exactly what returns
```

**3. Result row**

```text
path=/api/staff/* endpoints=12 guarded=GET-only=3 member=data-leak=1
```

## Pitfalls

- Pretending the member UI proves security, when UI absence and server refusal are entirely different facts.
- Testing admin endpoints only with an admin account, which can only confirm the happy path.
- Ignoring tenant-admin versus platform-admin distinctions, the most common split that products under-model.

## Done when

- Every administrative endpoint has a member-credential verdict recorded for every method it exposes.
- Client-side-only guards and data-echoing error paths, where found, are documented with reproduction requests.

## References

- [OWASP API Security Top 10](https://owasp.org/www-project-api-security/)
- [PortSwigger - access control vulnerabilities](https://portswigger.net/web-security/access-control)

