Summary
Refactor gated content decisions so they can use the backend access policy engine instead of relying only on client-side tier and role checks.
Current Behaviour
components/gated.tsx locally compares roles, membership tier, and membership active status. This duplicates policy logic in the frontend and may diverge from guildpass-core.
Expected Behaviour
The frontend should ask the access API whether the connected wallet can access a resource, then render allowed, denied, loading, or error states from that decision.
Suggested Implementation
Extend AccessApi with a checkAccess(resourceId, address) method. Implement it in mock and live clients. Update gated pages to pass a resource identifier instead of hard-coded tier logic where practical.
Files or Areas Likely Affected
components/gated.tsx
app/resources/alpha/page.tsx
app/events/demo/page.tsx
lib/api/types.ts
lib/api/live.ts
lib/api/mock.ts
Acceptance Criteria
Additional Notes
Assumption: guildpass-core exposes or will expose a resource access decision endpoint. If not, document the expected contract before implementing the live client.
Summary
Refactor gated content decisions so they can use the backend access policy engine instead of relying only on client-side tier and role checks.
Current Behaviour
components/gated.tsxlocally compares roles, membership tier, and membership active status. This duplicates policy logic in the frontend and may diverge fromguildpass-core.Expected Behaviour
The frontend should ask the access API whether the connected wallet can access a resource, then render allowed, denied, loading, or error states from that decision.
Suggested Implementation
Extend
AccessApiwith acheckAccess(resourceId, address)method. Implement it in mock and live clients. Update gated pages to pass a resource identifier instead of hard-coded tier logic where practical.Files or Areas Likely Affected
components/gated.tsxapp/resources/alpha/page.tsxapp/events/demo/page.tsxlib/api/types.tslib/api/live.tslib/api/mock.tsAcceptance Criteria
AccessApiexposes a typed access check methodLiveAccessApicalls the backend access check endpointMockAccessApisimulates allow and deny decisions consistentlyAdditional Notes
Assumption:
guildpass-coreexposes or will expose a resource access decision endpoint. If not, document the expected contract before implementing the live client.