feat(rest-api): ACL middleware for several endpoints#9690
Open
b-Nollet wants to merge 5 commits intomra-acl-v2from
Open
feat(rest-api): ACL middleware for several endpoints#9690b-Nollet wants to merge 5 commits intomra-acl-v2from
b-Nollet wants to merge 5 commits intomra-acl-v2from
Conversation
|
Linked to Plane Work Item(s)
This comment was auto-generated by Plane |
spacotte-vates
requested changes
Apr 13, 2026
MathieuRA
requested changes
Apr 16, 2026
3ad2902 to
b5f6e0b
Compare
MathieuRA
requested changes
Apr 16, 2026
0e45206 to
35abd64
Compare
MathieuRA
requested changes
Apr 21, 2026
Comment on lines
+65
to
+69
| getObject: <T extends XenApiRecord>( | ||
| // id is either uuid or ref | ||
| idOrUuidOrRef: T[Extract<'uuid', keyof T>] | T['$ref'], | ||
| defaultValue?: T | ||
| ) => T |
Member
There was a problem hiding this comment.
I suggest:
Suggested change
| getObject: <T extends XenApiRecord>( | |
| // id is either uuid or ref | |
| idOrUuidOrRef: T[Extract<'uuid', keyof T>] | T['$ref'], | |
| defaultValue?: T | |
| ) => T | |
| getObject: <XoRecord extends XapiXoRecord, WrappedRecord extends WrappedXenApiRecord = Extract<WrappedXenApiRecord, { $type: XoRecord['type'] }>>( | |
| idOrUuidOrRef: XoRecord['id'] | WrappedRecord['$ref'] | WrappedRecord['uuid'], | |
| defaultValue?: WrappedRecord | |
| ) => WrappedRecord |
So, idOrUuidOrRef reflect the 3 possible types: XO ID, or XAPI UUID or a XAPI $ref, and it return the XAPI object wrapped (with $xapi property, ..)
BTW, in pool.controller, you will need to change const template = pool.$xapi.getObject<XenApiVm>(req.body.template) to const template = pool.$xapi.getObject<XoVm>(req.body.template)
spacotte-vates
approved these changes
Apr 21, 2026
35abd64 to
de69c68
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Review by commit
ACL middleware for :
Checklist
Fixes #007,See xoa-support#42,See https://...)Introduced byCHANGELOG.unreleased.mdReview process
If you are an external contributor, you can skip this part. Simply create the pull request, and we'll get back to you as soon as possible.
Notes: