Skip to content

fix: Fixes SAML Role mapping of custom roles - #31790

Merged
ggazzo merged 7 commits into
RocketChat:developfrom
tiran133:patch-1
Mar 6, 2024
Merged

fix: Fixes SAML Role mapping of custom roles#31790
ggazzo merged 7 commits into
RocketChat:developfrom
tiran133:patch-1

Conversation

@tiran133

@tiran133 tiran133 commented Feb 20, 2024

Copy link
Copy Markdown
Contributor

Issue(s)

Fixes #31707
CORE-88

#31830

The issue is that the names of the roles get pulled here.

userObject.roles = savedRoles.map((role) => role.name);

But here only ids get validated here.

const existingRoleIds = (await Roles.findInIds<Pick<IRole, '_id'>>(roleIds, options).toArray()).map(({ _id }) => _id);

My change solves this problem by just pulling ids.

@changeset-bot

changeset-bot Bot commented Feb 20, 2024

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 48823af

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 31 packages
Name Type
@rocket.chat/meteor Patch
@rocket.chat/core-typings Patch
@rocket.chat/rest-typings Patch
@rocket.chat/apps Patch
@rocket.chat/core-services Patch
@rocket.chat/cron Patch
@rocket.chat/gazzodown Patch
@rocket.chat/livechat Patch
@rocket.chat/model-typings Patch
@rocket.chat/ui-contexts Patch
@rocket.chat/account-service Patch
@rocket.chat/authorization-service Patch
@rocket.chat/ddp-streamer Patch
@rocket.chat/omnichannel-transcript Patch
@rocket.chat/presence-service Patch
@rocket.chat/queue-worker Patch
@rocket.chat/stream-hub-service Patch
@rocket.chat/api-client Patch
@rocket.chat/license Patch
@rocket.chat/omnichannel-services Patch
@rocket.chat/pdf-worker Patch
@rocket.chat/presence Patch
rocketchat-services Patch
@rocket.chat/ddp-client Patch
@rocket.chat/fuselage-ui-kit Patch
@rocket.chat/models Patch
@rocket.chat/ui-client Patch
@rocket.chat/ui-video-conf Patch
@rocket.chat/uikit-playground Patch
@rocket.chat/web-ui-registration Patch
@rocket.chat/instance-status Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@CLAassistant

CLAassistant commented Feb 20, 2024

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

@scuciatto scuciatto added this to the 6.7 milestone Feb 21, 2024
@dionisio-bot dionisio-bot Bot added the stat: ready to merge PR tested and approved waiting for merge label Feb 22, 2024
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Feb 22, 2024
@codecov

codecov Bot commented Feb 22, 2024

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 54.63%. Comparing base (85fe51a) to head (48823af).
Report is 6 commits behind head on develop.

Additional details and impacted files

Impacted file tree graph

@@             Coverage Diff             @@
##           develop   #31790      +/-   ##
===========================================
+ Coverage    54.58%   54.63%   +0.05%     
===========================================
  Files         2280     2281       +1     
  Lines        50262    50276      +14     
  Branches     10254    10254              
===========================================
+ Hits         27436    27469      +33     
- Misses       20337    20353      +16     
+ Partials      2489     2454      -35     
Flag Coverage Δ
unit 76.44% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

@scuciatto scuciatto modified the milestones: 6.7, 7.0 Mar 5, 2024
@scuciatto scuciatto added the stat: ready to merge PR tested and approved waiting for merge label Mar 6, 2024
@dionisio-bot dionisio-bot Bot removed the stat: ready to merge PR tested and approved waiting for merge label Mar 6, 2024
@ggazzo ggazzo modified the milestones: 7.0, 6.7 Mar 6, 2024
@ggazzo
ggazzo merged commit 727402c into RocketChat:develop Mar 6, 2024
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.

Error: Invalid role [error-invalid-role] for custom roles as default role or SAML role sync

6 participants