1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-21 14:50:08 +03:00

B OpenNebula/one#6730: Search admin users in the right array (#3289)

Signed-off-by: dcarracedo <dcarracedo@opennebula.io>
Co-authored-by: Tino Vázquez <cvazquez@opennebula.io>
(cherry picked from commit e2c54b10a6b10aceaca89bcdf32bd09fd6c28259)
This commit is contained in:
David 2024-11-06 13:37:00 +01:00 committed by Tino Vázquez
parent f5b2a17360
commit 2340b0c0bc
No known key found for this signature in database
GPG Key ID: 14201E424D02047E

View File

@ -139,11 +139,11 @@ const getViews = (
// Check that the group has info
if (vmgroupData && vmgroupData.GROUP && vmgroupData.GROUP.NAME) {
// Check if the user is admin of the group
const admins = Array.isArray(vmgroupData.GROUP.ADMINS)
? vmgroupData.GROUP.ADMINS
: [vmgroupData.GROUP.ADMINS]
const admins = Array.isArray(vmgroupData.GROUP?.ADMINS?.ID)
? vmgroupData.GROUP.ADMINS?.ID
: [vmgroupData.GROUP.ADMINS?.ID]
const isAdminGroup = admins.some(
(admin) => admin.ID === dataUser.USER.ID
(admin) => admin === dataUser.USER.ID
)
// Get the views on the group template