Skip to content

docs(rbac): correct assigned_inboxes comment for secure-by-default agent (CRM-181) - #281

Merged
gomessguii merged 1 commit into
developfrom
fix/CRM-181-assigned-inboxes-comment
Aug 17, 2026
Merged

docs(rbac): correct assigned_inboxes comment for secure-by-default agent (CRM-181)#281
gomessguii merged 1 commit into
developfrom
fix/CRM-181-assigned-inboxes-comment

Conversation

@pastoriniMatheus

@pastoriniMatheus pastoriniMatheus commented Aug 17, 2026

Copy link
Copy Markdown
Contributor

CRM-181 (lado CRM) — corrige o comentário de User#assigned_inboxes

Par do PR do auth que revoga conversations.read_all do papel agent.

O comentário afirmava que a migration de upgrade deu read_all a todo papel pré-existente, logo revogar seria sempre "ato explícito do admin". Com o CRM-181 a data-migration do auth revoga read_all do papel agent de sistema automaticamente (secure-by-default) — o comentário viraria falso. Reescrito: o agent não tem mais read_all e vê só suas inboxes-membro; account_owner/super_admin mantêm; para roles custom, revogar segue sendo ato explícito do admin.

Só comentário — comportamento inalterado (o enforcement aqui, read_all/administrator?, já casa).

🤖 Generated with Claude Code

Summary by Sourcery

Enhancements:

  • Update the User#assigned_inboxes documentation to accurately describe secure-by-default inbox visibility and role-specific read_all permissions.

…ent (CRM-181)

The comment claimed the upgrade migration GAVE read_all to every pre-existing
role, so revoking it was always the admin's explicit act. With CRM-181 the
evo-auth data-migration REVOKES read_all from the system `agent` role
automatically (secure-by-default). Reword: the agent no longer holds read_all
and sees only its member inboxes; account_owner/super_admin keep it; for custom
roles, revoking remains the admin's explicit act. Behaviour unchanged — the
enforcement here (read_all/administrator? only) already matches.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sourcery-ai

sourcery-ai Bot commented Aug 17, 2026

Copy link
Copy Markdown
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates the documentation comment for User#assigned_inboxes to reflect the new secure-by-default behavior of the system agent role and its conversations.read_all grant, without changing runtime behavior.

File-Level Changes

Change Details Files
Clarified the User#assigned_inboxes comment to describe secure-by-default access for the system agent role and the relationship to conversations.read_all and custom roles.
  • Removed outdated explanation that the upgrade migration granted conversations.read_all to all pre-existing roles and framed revocation as always an explicit admin action.
  • Documented that the default agent role no longer has conversations.read_all and therefore only sees member inboxes, with no fallback for agents with no memberships.
  • Specified that account_owner and super_admin retain conversations.read_all while custom roles still require an explicit admin revocation.
  • Explained that the evo-auth CRM-181 data migration now automatically revokes conversations.read_all from the system agent role on upgrade, aligning the comment with the existing enforcement logic.
app/models/user.rb

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've reviewed your changes and they look great!


Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@pastoriniMatheus

Copy link
Copy Markdown
Contributor Author

ℹ️ Independente. Só corrige um comentário (user.rb#assigned_inboxes) — sem dependência de merge.

Ordem geral da leva (desmembramento do antigo PR #84):

Os 4 PRs do auth tocam os mesmos arquivos (db/seeds/rbac.rb, rbac_spec.rb, versão do db/schema.rb) → mergeiam em ordem, com rebase: #85 (178) → #86 (181) → #87 (182) → #88 (190). schema.rb resolve para a versão maior.

Par de deploy: #85 (auth, a chave pipeline_items.update) ⟷ #272 (CRM, o gate) — subir juntos.

Independentes (sem ordem): #281 (CRM-181 comentário), #282 (CRM-182 spec), #283 (CRM-190 spec), #310 (CRM-178 front).

🤖 Generated with Claude Code

@gomessguii
gomessguii merged commit c13ca8d into develop Aug 17, 2026
11 checks passed
@gomessguii
gomessguii deleted the fix/CRM-181-assigned-inboxes-comment branch August 17, 2026 23:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants