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

[NU-1649] Add impersonate mechanism #6053

Merged
merged 11 commits into from
Jun 6, 2024

Conversation

Elmacioro
Copy link
Contributor

@Elmacioro Elmacioro commented May 14, 2024

Describe your changes

Currently, when a technical user performs an action on behalf of a business user, they become an author of that action instead of the business user who initiated it.

In these changes I introduced a possibility to impersonate a business user. During mapping from AuthenticatedUser to LoggedUser, when a technical user has appropriate permission (Overrideusername) and impersonatedUser field is present, impersonatedUser will be mapped as LoggedUser and their permissions will be used for authorization.

As a result of these changes new column impersonated_by was added to 4 database tables:

  • process_attachments
  • process_comments
  • process_actions
  • processes

With that it should be possible to extinguish which technical user acted on behalf of a business user for certain operations.

In the next PR I will introduce changes to the process migration mechanism to utilize new impersonate mechanism instead of passing remoteUsername values.

Checklist before merge

  • Related issue ID is placed at the beginning of PR title in [brackets] (can be GH issue or Nu Jira issue)
  • Code is cleaned from temporary changes and commented out lines
  • Parts of the code that are not easy to understand are documented in the code
  • Changes are covered by automated tests
  • Showcase in dev-application.conf added to demonstrate the feature
  • Documentation added or updated
  • Added entry in Changelog.md describing the change from the perspective of a public distribution user
  • Added MigrationGuide.md entry in the appropriate subcategory if introducing a breaking change
  • Verify that PR will be squashed during merge

@github-actions github-actions bot added the docs label May 15, 2024
@Elmacioro Elmacioro force-pushed the NU-1649-add-impersonate-mechanism branch from 9f49487 to 3327434 Compare May 16, 2024 07:14
@Elmacioro Elmacioro marked this pull request as ready for review May 16, 2024 08:07
@Elmacioro Elmacioro force-pushed the NU-1649-add-impersonate-mechanism branch from 14c48a6 to 7f3b512 Compare May 17, 2024 14:47
Copy link
Member

@arkadius arkadius left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

github-actions bot commented May 24, 2024

created: #6146
⚠️ Be careful! Snapshot changes are not necessarily the cause of the error. Check the logs.

@Elmacioro Elmacioro force-pushed the NU-1649-add-impersonate-mechanism branch from e92b1f8 to b528c71 Compare May 31, 2024 12:55
@Elmacioro Elmacioro force-pushed the NU-1649-add-impersonate-mechanism branch from 8247986 to 61074d3 Compare June 4, 2024 09:28
Copy link
Contributor

@mk-software-pl mk-software-pl left a comment

Choose a reason for hiding this comment

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

Just minor comments left.
LGTM. Great change!

@Elmacioro Elmacioro force-pushed the NU-1649-add-impersonate-mechanism branch from 61bf3bc to b90dc83 Compare June 6, 2024 11:24
@Elmacioro Elmacioro force-pushed the NU-1649-add-impersonate-mechanism branch from b555c5c to 0bdd766 Compare June 6, 2024 16:29
docs/MigrationGuide.md Outdated Show resolved Hide resolved
@Elmacioro Elmacioro merged commit e674b73 into staging Jun 6, 2024
19 checks passed
@Elmacioro Elmacioro deleted the NU-1649-add-impersonate-mechanism branch June 6, 2024 17:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants