Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Cases] Suggest user profiles with read permission #172047

Merged
merged 4 commits into from
Nov 29, 2023

Conversation

adcoelho
Copy link
Contributor

@adcoelho adcoelho commented Nov 28, 2023

Fixes #171446

Summary

We will now also suggest users with only Read Cases permissions for case assignment.

Release notes

Fixed a bug that prevented users with read permission from being assigned to cases.

@adcoelho adcoelho added bug Fixes for quality problems that affect the customer experience release_note:skip Skip the PR/issue when compiling release notes Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) Feature:Cases Cases feature v8.12.0 labels Nov 28, 2023
@adcoelho adcoelho self-assigned this Nov 28, 2023
@adcoelho adcoelho changed the title [Cases ]Also suggest profiles with only read permissions. [Cases] Suggest user profiles with read permission Nov 28, 2023
@adcoelho adcoelho marked this pull request as ready for review November 28, 2023 12:37
@adcoelho adcoelho requested a review from a team as a code owner November 28, 2023 12:37
@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops (Team:ResponseOps)

@elasticmachine
Copy link
Contributor

Pinging @elastic/response-ops-cases (Feature:Cases)

@@ -62,7 +59,7 @@ export default ({ getService }: FtrProviderContext): void => {
suggestedSecUsers = await suggestUserProfiles({
supertest: supertestWithoutAuth,
req: {
name: secOnlyInfo.username!,
name: 'all_spaces',
Copy link
Contributor Author

Choose a reason for hiding this comment

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

securityPluginStart.userProfiles.suggest seems to do a fuzzy match on the name field so sec_user_all_spaces was now returning another security user, sec_user_read. Changing it here guarantees the right profile is returned.

@adcoelho adcoelho added release_note:fix and removed release_note:skip Skip the PR/issue when compiling release notes labels Nov 28, 2023
Copy link
Member

@cnasikas cnasikas left a comment

Choose a reason for hiding this comment

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

I tested it and I could assign a user with only read access to a case.

auth: { user: superUser, space: 'space1' },
});

expectSnapshot(profiles.map(({ user, data }) => ({ user, data }))).toMatchInline(`
Copy link
Member

Choose a reason for hiding this comment

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

TIL 🚀

@kibana-ci
Copy link
Collaborator

💚 Build Succeeded

Metrics [docs]

✅ unchanged

History

To update your PR or re-run it, just comment with:
@elasticmachine merge upstream

cc @adcoelho

@adcoelho adcoelho merged commit e333c6e into elastic:main Nov 29, 2023
29 checks passed
@kibanamachine kibanamachine added the backport:skip This commit does not require backporting label Nov 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport:skip This commit does not require backporting bug Fixes for quality problems that affect the customer experience Feature:Cases Cases feature release_note:fix Team:ResponseOps Label for the ResponseOps team (formerly the Cases and Alerting teams) v8.12.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Cases] Read only users cannot be assigned cases in the UI
5 participants