Uh oh!
There was an error while loading. Please reload this page.
Remove unnecessary if-else branch in template permission validation - #12683
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@## main #12683 +/- ##
============================================
+ Coverage 17.92% 18.00% +0.08% - Complexity 16154 16465 +311
============================================
Files 5939 5977 +38 Lines 533181 537728 +4547 Branches 65237 66025 +788 ============================================
+ Hits 95585 96840 +1255 - Misses 426856 429968 +3112 - Partials 10740 10920 +180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
sudo87
commented
Feb 25, 2026
@blueorangutan package |
blueorangutan
commented
Feb 25, 2026
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
Feb 25, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 16937 |
There was a problem hiding this comment.
Pull request overview
This PR fixes an access control issue for non-public templates accessed by non-admin users. The fix ensures that ownership semantics are properly enforced by changing the sameOwner parameter from false to true in the access check for non-public templates.
Changes:
- Fixed access control check for non-public templates to enforce ownership semantics by setting
sameOwner=trueinstead offalse - Minor code formatting change (consolidating else-if statement onto one line)
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
winterhazel
commented
Mar 28, 2026
@sudo87 is this change related to a specific issue/situation? This flag is just used to ensure that all the controlled entities provided to |
sudo87
commented
Mar 30, 2026
Hi @winterhazel, this change is based on how checkAccess is used here. Right now we pass sameOwner = false, which effectively relaxes the ownership check. Please let me know if change makes sense. |
winterhazel
commented
Apr 6, 2026
@sudo87 have a look at what |
sudo87
commented
Apr 7, 2026
Thanks @winterhazel for the hint, I misunderstood the flow. Since both branches were effectively doing the same checkAccess call, I have consolidated them. Please review if changes are good. |
winterhazel
left a comment
There was a problem hiding this comment.
LGTM, just need to change the PR's title
sudo87
commented
May 6, 2026
@blueorangutan package |
blueorangutan
commented
May 6, 2026
@sudo87 a [SL] Jenkins job has been kicked to build packages. It will be bundled with no SystemVM templates. I'll keep you posted as I make progress. |
blueorangutan
commented
May 6, 2026
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ el10 ✔️ debian ✔️ suse15. SL-JID 17731 |
sudo87
commented
May 6, 2026
@blueorangutan test |
blueorangutan
commented
May 6, 2026
@sudo87 a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
blueorangutan
commented
May 7, 2026
[SF] Trillian test result (tid-16021)
|
winterhazel
commented
May 8, 2026
As this patch does not change the behavior of the code, I'm merging it already. |
Uh oh!
There was an error while loading. Please reload this page.
Description
Permission access check looks incorrect for non-public template and non admin user.
Provided non-public templates are not shareable, check must ensure that template is owned by user. For public, ownership flag is passed as false, which makes sense as template can be created by other user.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?