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:
parent
f5b2a17360
commit
2340b0c0bc
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user