-
Notifications
You must be signed in to change notification settings - Fork 1.2k
create parameter to determine whether roles are public or private #6960
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
create parameter to determine whether roles are public or private #6960
Conversation
Codecov Report
@@ Coverage Diff @@
## main #6960 +/- ##
============================================
- Coverage 12.70% 12.70% -0.01%
- Complexity 8691 8693 +2
============================================
Files 2729 2729
Lines 256608 256641 +33
Branches 39993 39994 +1
============================================
- Hits 32605 32604 -1
- Misses 219853 219889 +36
+ Partials 4150 4148 -2
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
1 similar comment
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
@GaOrtiga , can you look at the conflicts? |
Done. |
JoaoJandre
left a comment
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.
CLGTM
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
Sorry @GaOrtiga , conflicts again. This happens a lot as we get close to release :( |
73fb2bb to
f4d435f
Compare
Yes, I resolved them, thanks! |
api/src/main/java/org/apache/cloudstack/api/command/admin/acl/ListRolesCmd.java
Outdated
Show resolved
Hide resolved
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ debian ✔️ suse15. SL-JID 5023 |
|
@blueorangutan test |
|
@GaOrtiga do you think regression/integration tests as sensible for this change? |
…ListRolesCmd.java Co-authored-by: dahn <daan.hoogland@gmail.com>
Do you mean for the PR as a whole or for this last change submitted? If it is for the whole PR, I have run some regression tests and all of them worked out properly, however if you have concerns about any specific functionality, I can run some more. If it is for this last change I don´t think any other testing is necessary, since the arguments deleted were really not being used. |
|
No, I meant for the functionality in this PR in general. And I mean in an automated fashion so they can serve as regression tests in the future. I.e. automate the scenario you described under "How Has This Been Tested?". |
|
@DaanHoogland Oh, I see. |
|
Trillian test result (tid-5576)
|
Co-authored-by: dahn <daan.hoogland@gmail.com>
|
This pull request has merge conflicts. Dear author, please fix the conflicts and sync your branch with the base branch. |
|
SonarCloud Quality Gate failed. |
|
@DaanHoogland Can we proceed with this PR or is there any other concern regarding it? |
no concerns |
|
@blueorangutan package |
|
@DaanHoogland a Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
|
Packaging result: ✔️ el7 ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 5996 |
|
@blueorangutan test |
|
@DaanHoogland a Trillian-Jenkins test job (centos7 mgmt + kvm-centos7) has been kicked to run smoke tests |
|
Trillian test result (tid-6488)
|
|
@DaanHoogland this has been merged in |
Signed-off-by: Abhishek Kumar <abhishek.mrt22@gmail.com>
thanks @shwstppr , I missed that. I can revert, but I see you added a commit on top of this. What do you propose we do? |
|
Note how the smoke tests passed and didn't warn me about my error. An upgrade test would have caught this :| |








Description
ACS does not allow the operator to define the visibility of roles, meaning all of them are visible to all users, with the exception of Root Admin roles.
In order to address this situation, a new parameter
public_rolehas been created in the following APIs:createRole,updateRoleandimportRole. This parameter adds a new property to the role, allowing it to be hidden from the users; so, when updating, importing or creating a new role it is possible for the operator to inform if it is public (visible to all users) or private (only visible to Root Admins and the creator of the role). Also, the behavior of the APIlistRoleshas been adjusted to return the roles according to this new property.The following are examples of the listings using a Root Admin account and a Domain Admin account.
Listing with a Root Admin account
Listing with a Domain Admin account
Example of the other APIs:
createRole
updateRole
importRole
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
How Has This Been Tested?
I created two new roles using the
createRoleAPI. One with the parameterpublic_roleset tofalseand one with it set totrue. I verified that both roles were successfully created with the specified parameters.I repeated the same steps from the first test, but this time using the
importRoleAPI instead. I verified that the roles were successfully imported with the specified parameters.I updated the
public_roleparameter from two different roles using theupdateRoleAPI, the first one had the parameter astrueand I updated it tofalseand the second had it asfalseand I updated it totrue. Both were successfully updated.I used the API
listRolesusing a Root Admin account and verified that every role was visible.I used the API
listRolesusing a Domain Admin account and verified that it could not see private roles.I created an account of the type user using a private role and verified that it could log in.
With this same account I created a new network, and a new VM, and verified that both worked normally.
I repeated tests 6 and 7 but this time with an account of the type Root Admin, and verified that it worked aswell.