-
Notifications
You must be signed in to change notification settings - Fork 101
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
feat(MultiGroupsForUsers): Added support for user to be part of multiple secondary groups and assume different secondary roles #1187
Conversation
9e23b54
to
a35cd8f
Compare
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.
Reviewed the code, suggested some changes.
.../src-moderation/src/main/java/org/eclipse/sw360/moderation/db/ModerationDatabaseHandler.java
Outdated
Show resolved
Hide resolved
...-portlet/src/main/java/org/eclipse/sw360/portal/tags/DisplayMapOfSecondaryGroupAndRoles.java
Outdated
Show resolved
Hide resolved
...-portlet/src/main/java/org/eclipse/sw360/portal/tags/DisplayMapOfSecondaryGroupAndRoles.java
Outdated
Show resolved
Hide resolved
...datahandler/src/main/java/org/eclipse/sw360/datahandler/permissions/DocumentPermissions.java
Outdated
Show resolved
Hide resolved
...-datahandler/src/main/java/org/eclipse/sw360/datahandler/permissions/ProjectPermissions.java
Outdated
Show resolved
Hide resolved
frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/admin/UserPortlet.java
Outdated
Show resolved
Hide resolved
frontend/sw360-portlet/src/main/java/org/eclipse/sw360/portal/portlets/admin/UserPortlet.java
Outdated
Show resolved
Hide resolved
...-portlet/src/main/java/org/eclipse/sw360/portal/tags/DisplayMapOfSecondaryGroupAndRoles.java
Outdated
Show resolved
Hide resolved
secGrpsUserFormDiv.removeClass("d-none"); | ||
$("#secGrpsUserFormDiv").remove(); | ||
$(".editUser").click(function(){ | ||
dialog.confirm('info', 'users', '<liferay-ui:message key="edit.users.secondary.departments.and.role" />', secGrpsUserFormDiv.clone(true, true), '<liferay-ui:message key="edit" />', { |
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.
I guess button with label Save
would make more sense here instead of Edit
in modal pop-up.
& how about keeping 1 row added by default on load of modal pop-up instead of making user add the very first row?
One more thing, clicking on Edit
button without adding any rows, makes a call to backend and show the success/error message, as shown in above screenshot. (not an appropriate use case, ideally Save
button should be disabled or a backend call should not happen unless a row is added)
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.
I guess button with label Save would make more sense here instead of Edit in modal pop-up.
- Changed Edit button to
Save
button
One more thing, clicking on Edit button without adding any rows, makes a call to backend and show the success/error message, as shown in above screenshot. (not an appropriate use case, ideally Save button should be disabled or a backend call should not happen unless a row is added)
Use case - Save without any row
- User has some Secondary roles and Groups, now all of those secondary group and roles needs to be removed.
how about keeping 1 row added by default on load of modal pop-up instead of making user add the very first row?
a35cd8f
to
c697e7b
Compare
Thanks for review. |
c697e7b
to
2824825
Compare
Ideas for testing:
|
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.
Reviewed the code. looks good to me.
I did some tests for this functionality and found some possible bugs. However, I am newer of sw360, if there is something wrong, please let me know. Test Report for Multi GroupsTest 1: Old functionality TestDescription: Test Case 1.1: Result 1.1: Test 2: Edit Secondary Department TestDescription: Test Case 2.1: Result 2.1: Test 3: Project functionality Test with secondary departments and rolesDescription: Test Case 3.1: (View/List) **Result 3.1: ** Test Case 3.2: (Update/Edit) Result 3.2: **Test Case 3.3: **(Delete) Result 3.2: Test Case 3.4: (Create) Result 3.4: **Test Case 3.5: **(View/accept/decline a moderation request) Result 3.5: Test Case 3.6: (Create/view/accept/decline clearing request) Result 3.6: |
Given a test from REST side with the below scenarios successfully. Testing Steps: (With primary role as "User" and secondary role "Clearing Admin"):
|
2824825
to
0192b29
Compare
Hi @shi9qiu ,Thank you for the test.
|
Thank you! @JaideepPalit I will do more test about this! |
0192b29
to
92d8fd1
Compare
(from discussion)
Note - |
Few tests from my side w.r.t components and release update with primary role as "User" and secondary role as "Clearing Admin" in test instance.
|
Question : #831 is fixed by this pull request ? |
…ple secondary groups and assume different secondary roles Signed-off-by: Jaideep Palit <jaideep.palit@siemens.com>
92d8fd1
to
eb550dc
Compare
Resolved Merge Conflict |
Hi @KoukiHama , from our internal discussion few weeks back, it was suggested that
Maybe we can discuss more in today's telco. |
I got it! Thank you! @JaideepPalit |
I have tested what I tested before. It seems no problem for me now. Removing "ADMIN" and keeping "SW360_ADMIN" is good for me. As a newcomer, I was confusing about the difference between them before. Of course, the functionality needs more tests. I will do more if I am available. |
Issue: closes #1163
How To Test?
View/Create/Update/Delete/Moderation Request/Clearing Request
forProject, Component, Releases, Licenses
GROUP1
has Primary role asUSER
but has secondary Roles asADMIN in GROUP2
. then inGROUP1
he acts asnormal user
but inGROUP2
he acts asADMIN
.Create/Update/Delete/List Projects
,Search Projects
,(Moderation Request - View/Accept/Decline for Project, Component, Releases, Licenses )
,Clearing Request
on below logic like -Note - Both UI and REST API needs to be tested
Clearing Request-
AND
User is has Primary Role or Secondary role in that Groupatleast CLEARING_EXPERT
Moderation Request
Clearing Admin
and if Project is not closed -> creator, ProjectResponsible and ModeratorsClearing Admin
and if Project is not closed -> creator and ModeratorsClearing Admin
Project
Checklist
Must:
Signed-off-by: Jaideep Palit jaideep.palit@siemens.com