Skip to content

Add soft archive support for resources and policies #50

Description

@Lakes41

Difficulty: Advanced

Type: Feature

Summary

Introduce archive states for resources and policies so admins can retire access rules without deleting historical records.

Current Behaviour

Policies and resource-like concepts are either active or absent. Deleting records directly would make audit trails and historical access decisions harder to explain.

Expected Behaviour

Resources and policies should support archived states, and access checks should ignore archived policies unless explicitly querying history.

Suggested Implementation

Add archivedAt or state fields to resource and policy models. Update service queries to exclude archived records by default. Add admin routes for archiving and restoring where appropriate.

Files or Areas Likely Affected

  • apps/access-api/prisma/schema.prisma
  • apps/access-api/src/services/policyService.ts
  • apps/access-api/src/services/resourceService.ts
  • apps/access-api/src/services/memberService.ts
  • packages/shared-types/src/index.ts

Acceptance Criteria

  • Policies can be archived without deletion
  • Resources can be archived without deletion
  • Access checks ignore archived policies by default
  • Audit events preserve historical resource and policy references
  • Admin listing endpoints can include or exclude archived records
  • Tests cover archive, restore, and access-check behaviour

Additional Notes

Assumption: preserving history matters for auditability and operational support.

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardOfficial CampaignCampaign: Official Campaign

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions