Skip to content

Conversation

@diegolmello
Copy link
Member

@diegolmello diegolmello commented Nov 6, 2025

Proposed changes

Issue(s)

https://rocketchat.atlassian.net/browse/ABAC-77

How to test or reproduce

Screenshots

ABAC managed room

image

Not ABAC

image

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Improvement (non-breaking change which improves a current function)
  • New feature (non-breaking change which adds functionality)
  • Documentation update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc
  • I have signed the CLA
  • Lint and unit tests pass locally with my changes
  • I have added tests that prove my fix is effective or that my feature works (if applicable)
  • I have added necessary documentation (if applicable)
  • Any dependent changes have been merged and published in downstream modules

Further comments

Summary by CodeRabbit

  • New Features

    • Added support for ABAC (Attribute-Based Access Control) attributes display in room headers and items.
    • New shield icons indicate rooms with restricted access attributes.
    • Invite functionality is now hidden for rooms with active ABAC attributes.
  • Tests

    • Added test cases for ABAC attribute display scenarios.
  • Chores

    • Updated database schema to store ABAC attributes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Nov 6, 2025

Caution

Review failed

Failed to post review comments

Walkthrough

Introduces ABAC (Attribute-Based Access Control) attribute support across the application. Adds abacAttributes prop to UI components, database schema, and models. New shield icons added for classified rooms. Conditional rendering updated to restrict user invitations when ABAC attributes are present.

Changes

Cohort / File(s) Summary
Icon mappings
app/containers/CustomIcon/mappedIcons.js
Added two new icon code mappings: hash-shield (59878) and team-shield (59877)
Database schema & version
app/lib/database/schema/app.js, app/lib/database/model/migrations.js
Bumped schema version to 28; added abac_attributes string column to subscriptions table; added migration step for version 28
Database model & types
app/lib/database/model/Subscription.js, app/definitions/ISubscription.ts
Added abacAttributes field to Subscription model with JSON decorator; extended ISubscription interface with optional abacAttributes: string[]
Data merge logic
app/lib/methods/helpers/mergeSubscriptionsRooms.ts
Added placeholder abacAttributes assignment during subscription-room merge with TODO comment for future replacement
Component interfaces
app/containers/RoomItem/interfaces.ts
Added abacAttributes?: ISubscription['abacAttributes'] to ITypeIconProps, IRoomItemProps, and IIconOrAvatar
RoomTypeIcon component
app/containers/RoomTypeIcon/index.tsx, app/containers/RoomTypeIcon/RoomTypeIcon.stories.tsx
Added abacAttributes prop; updated icon selection logic to use team-shield or hash-shield when abacAttributes is present; added story examples
RoomItem component hierarchy
app/containers/RoomItem/TypeIcon.tsx, app/containers/RoomItem/IconOrAvatar.tsx, app/containers/RoomItem/RoomItem.tsx, app/containers/RoomItem/RoomItem.stories.tsx, app/containers/RoomItem/index.tsx
Threaded abacAttributes prop through component chain; added story examples
RoomHeader component
app/containers/RoomHeader/RoomHeader.tsx, app/containers/RoomHeader/index.tsx, app/containers/RoomHeader/RoomHeader.stories.tsx
Added abacAttributes prop; propagated to RoomTypeIcon in nested and main render paths; added story examples
View layer prop propagation
app/views/RoomView/index.tsx, app/views/RoomActionsView/index.tsx, app/views/RoomInfoView/components/RoomInfoViewTitle.tsx
Added abacAttributes prop to RoomHeader and RoomTypeIcon usages in various views
Members view actions
app/views/RoomMembersView/components/ActionsSection.tsx, app/views/RoomMembersView/index.tsx
Extended ActionsSection interface with abacAttributes; updated conditional rendering to hide "Invite users" action when abacAttributes is present

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Rationale: Highly homogeneous changes across files—same pattern of adding and threading an optional abacAttributes prop through component hierarchies and updating related interfaces. Database changes are straightforward schema/migration additions. Limited logic density: primary complexity is conditional rendering in RoomTypeIcon icon selection and ActionsSection visibility check.
  • Areas requiring attention:
    • Verify placeholder ABAC values in mergeSubscriptionsRooms.ts are properly tagged for future replacement
    • Confirm conditional logic in ActionsSection correctly restricts invitations (falsy check on abacAttributes)
    • Validate schema migration version sequence and database column type alignment

Poem

🛡️ With shields of hash and team so bright,
ABAC attributes now take flight!
Through components they gently flow,
Classified rooms begin to glow. 🔐
Invites are guarded, access refined—
A safer realm we're here designed! ✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately reflects the main objective: implementing ABAC feature to disable/remove invite functionality for ABAC-managed rooms.
Linked Issues check ✅ Passed The implementation successfully disables the 'Share invite link' button for ABAC-managed rooms by making ActionsSection conditionally render the Invite_users action only when abacAttributes is falsy.
Out of Scope Changes check ✅ Passed All changes are in-scope for ABAC feature implementation: icon mappings, prop propagation for abacAttributes, database schema updates, and UI logic to disable invites on ABAC rooms.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch abac-77

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@diegolmello diegolmello changed the base branch from develop to abac-75 November 6, 2025 15:11
@diegolmello diegolmello requested a deployment to official_android_build November 6, 2025 15:13 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to experimental_android_build November 6, 2025 15:13 — with GitHub Actions Waiting
@diegolmello diegolmello requested a deployment to experimental_ios_build November 6, 2025 15:13 — with GitHub Actions Waiting
Copy link
Contributor

@OtavioStasiak OtavioStasiak left a comment

Choose a reason for hiding this comment

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

Looks good to me!

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.

3 participants