Skip to content

Docs: Add context to BCell authorization examples #63

@kluth

Description

@kluth

Problem

BCell authorization examples lack context about role assignment and permission storage.

Affected Files

Documentation: /home/matthias/projects/synapse/docs/systems/immune/README.md (lines 375-408)

Issue Details

Severity: LOW
Impact: May cause confusion during implementation

Current Example

const result = await authz.authorize({
  userId: 'user-123',  // How does BCell know user-123's permissions?
  resource: 'posts',   // What format should this be?
  action: 'create',    // What actions are valid?
});

Missing Context

  1. How does BCell store and retrieve user roles?
  2. What's the expected format of resource and action strings?
  3. What happens if user has no roles assigned?
  4. Where are role-permission mappings stored?
  5. Can you query a user's current roles?

Recommended Enhancement

Add explanation sections:

  • Role assignment and storage mechanism
  • Resource/action naming conventions
  • Permission lookup process
  • Error handling for missing roles
  • Role query methods

Priority

LOW - Contextual enhancement for better understanding

References

User Story

As a developer implementing authorization, I want to understand how BCell stores and retrieves permissions, so that I can properly set up and query the authorization system.

Acceptance Criteria

  • Explain role storage mechanism
  • Document resource/action format conventions
  • Add role query examples
  • Document error conditions
  • Include persistence considerations

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestlowLow priority - backlog

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions