Skip to content

Introduce role-based permissions for dashboard actions #28

@Lakes41

Description

@Lakes41

Summary

Add a permission model that distinguishes read-only users from admins who can manage passes, members, guild settings, and integration configuration.

Current Behaviour

Management pages are grouped under the same dashboard navigation and do not appear to enforce action-level permissions. Once a user can access the dashboard, there is no fine-grained permission boundary for sensitive actions.

Expected Behaviour

Dashboard actions should be guarded by explicit permissions such as passes:write, members:write, guilds:write, and settings:write.

Suggested Implementation

Define a permission matrix and helper functions such as canManagePasses, canManageMembers, and canEditSettings. Add a mock session model with roles and permissions. Use the helpers to hide or disable actions and protect mutation handlers.

Files or Areas Likely Affected

  • apps/dashboard/lib/auth/
  • apps/dashboard/lib/permissions.ts
  • apps/dashboard/components/DashboardLayout.tsx
  • apps/dashboard/app/passes/page.tsx
  • apps/dashboard/app/members/page.tsx
  • apps/dashboard/app/settings/page.tsx

Acceptance Criteria

  • A typed permission model is defined
  • Read-only users cannot access write actions
  • UI controls are hidden or disabled based on permissions
  • Mutation handlers also enforce permissions
  • Mock sessions cover owner, admin, moderator, and read-only roles
  • Documentation explains the supported roles and permissions

Additional Notes

This should not rely only on UI hiding. Live mode must still depend on backend enforcement for authoritative security.

Metadata

Metadata

Assignees

Labels

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

Type

No type
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