-
Notifications
You must be signed in to change notification settings - Fork 22
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
fix(appRoles): don't allowed to upload duplicate app roles #877
fix(appRoles): don't allowed to upload duplicate app roles #877
Conversation
- eliminate duplicate role values from api: /api/apps/appreleaseprocess/{appId}/role & /api/apps/AppChange/{appId}/role/activeapp - added new api to batch delete recently uploaded app roles: /api/apps/appreleaseprocess/{appId}/roles:batchDelete [Ref: eclipse-tractusx#868](eclipse-tractusx#868)
src/portalbackend/PortalBackend.DBAccess/Repositories/UserRolesRepository.cs
Fixed
Show fixed
Hide fixed
tests/marketplace/Apps.Service.Tests/BusinessLogic/AppChangeBusinessLogicTest.cs
Fixed
Show fixed
Hide fixed
tests/marketplace/Apps.Service.Tests/BusinessLogic/AppReleaseBusinessLogicTest.cs
Fixed
Show fixed
Hide fixed
tests/marketplace/Apps.Service.Tests/BusinessLogic/AppReleaseBusinessLogicTest.cs
Fixed
Show fixed
Hide fixed
tests/marketplace/Apps.Service.Tests/BusinessLogic/AppReleaseBusinessLogicTest.cs
Fixed
Show fixed
Hide fixed
tests/marketplace/Apps.Service.Tests/BusinessLogic/AppChangeBusinessLogicTest.cs
Fixed
Show fixed
Hide fixed
tests/marketplace/Apps.Service.Tests/BusinessLogic/AppChangeBusinessLogicTest.cs
Fixed
Show fixed
Hide fixed
src/portalbackend/PortalBackend.DBAccess/Repositories/UserRolesRepository.cs
Fixed
Show resolved
Hide resolved
src/portalbackend/PortalBackend.DBAccess/Repositories/UserRolesRepository.cs
Fixed
Show resolved
Hide resolved
Unreadable error message is been respnded by the API, when admin or manager was trying to assign duplicate app roles to a user. before fix: roles System.Linq.Enumerable\u002BSelectEnumerableIterator\u00602[Org.Eclipse.TractusX.Portal.Backend.PortalBackend.DBAccess.Models.UserRoleModificationData,System.String] are ambigous after fix: roles [Manager, 779c63ba-025c-4d5e-a4e8-cd3c827eb49c] are ambigous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @tfjanjua thank you for the contribution! could you please resolve the remaining codeQL findings "Useless assignment to local variable"?
Hi @ntruchsess @Phil91 could you please review? |
src/portalbackend/PortalBackend.DBAccess/Repositories/UserRolesRepository.cs
Outdated
Show resolved
Hide resolved
src/marketplace/Apps.Service/BusinessLogic/AppReleaseBusinessLogic.cs
Outdated
Show resolved
Hide resolved
merge_postponed as a decision about the endpoint semantics need be made, @MaximilianHauer could you please provide your feedback? |
- Removed Distinct from AppExtension (Zip) - Removed checks from Repository and moved it to BusinessLogic - Updated local veriables
Hi @evegufy , do you think we can merge this PR (if all looks good) and then frontend will take their part as per their capacity? because it will not break any frontend functionality but it would be nice if frontend would also work on it and resolve their part (Please check the Proposed Solution heading: #868) I can also separate bug (stopping user from uploading duplicate app user roles bug fix) and new API (to bulk delete recently added Roles) in separate PRs so, we could have bug fix quickly available. Just FYI: we already have frontend capacity available to work on frontend part related to resolving the bug (stopping user from uploading duplicate app user roles bug fix) and implementing the new API (to bulk delete recently added Roles) cc: @ybidois | @MaximilianHauer | @ntruchsess | @Phil91 |
Hi @tfjanjua, afaik, @ntruchsess @MaximilianHauer were discussing about the implementation approach with the batch delete... |
…ecenlty added App User Roles
Hi @evegufy, I discussed with @ntruchsess and he explained the business behind this App User Roles and as per his explanation, it makes sense to replace all the App User Roles when user re-upload them and keep only the new ones instead of all roles (like previously uploaded and recently added from Add Roles option of any Active app) and just ignore the duplicate roles. So, I have removed the implementation of new API (to delete recently uploaded App User Roles) from this PR and now this PR only has a fix to stop users to upload duplicate roles and we need this fix for our release because if user uploads duplicate roles from any screen (App Onboarding->Technical Integration screen OR Load Additional Roles) so, later ending up encountering 409 conflict errors while assigning those duplicated App User Roles to a Company Users. Later (as we can see @Phil91 has added this PR in release 24.12) we can implement/change the existing API of Upload App User Roles as per @ntruchsess 's explanation but this fix will stop users to upload duplicate roles till r24.12. So, please let me know if this PR can be merge OR should I close this PR and create another one? that new PR will also have 'Stop user to upload duplicate roles' fix. cc: @ybidois | @MaximilianHauer |
@tfjanjua good, if it only contains the fix to stop users from uploading duplicate roles, I'll change the milestone to 2.2.0 and the base to the according release branch. |
801050d
to
6ca675f
Compare
Quality Gate passedIssues Measures |
11390e5
into
eclipse-tractusx:release/v2.2.0-RC2
Description
Why
An app should have unique roles, duplicate roles are causing issue while assigning app roles to any company user.
Issue
Ref: #868
Checklist
Please delete options that are not relevant.