|
1404 | 1404 | var allowedActions = []; |
1405 | 1405 |
|
1406 | 1406 | // "Edit Template", "Copy Template", "Create VM" |
1407 | | - if ((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) //if neither root-admin, nor item owner |
| 1407 | + if ((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account) && !(jsonObj.domainid == g_domainid && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id)) //if neither root-admin, nor the same account, nor the same project |
1408 | 1408 | || jsonObj.templatetype == "SYSTEM" || jsonObj.isready == false) { |
1409 | 1409 | //do nothing |
1410 | 1410 | } |
|
1418 | 1418 | } |
1419 | 1419 |
|
1420 | 1420 | // "Download Template" |
1421 | | - if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) //if neither root-admin, nor item owner |
| 1421 | + if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account) && !(jsonObj.domainid == g_domainid && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id))) //if neither root-admin, nor the same account, nor the same project |
1422 | 1422 | || (jsonObj.isready == false) || jsonObj.templatetype == "SYSTEM") { |
1423 | 1423 | //do nothing |
1424 | 1424 | } |
|
1444 | 1444 | var jsonObj = args.context.item; |
1445 | 1445 | var allowedActions = []; |
1446 | 1446 |
|
1447 | | - if ((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) //if neither root-admin, nor item owner |
| 1447 | + if ((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account) && !(jsonObj.domainid == g_domainid && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id)) //if neither root-admin, nor the same account, nor the same project |
1448 | 1448 | || (jsonObj.isready == false) |
1449 | 1449 | || (jsonObj.domainid == 1 && jsonObj.account == "system") |
1450 | 1450 | ) { |
|
1460 | 1460 | // "Create VM" |
1461 | 1461 | // Commenting this out for Beta2 as it does not support the new network. |
1462 | 1462 | /* |
1463 | | - //if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) |
| 1463 | + //if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account) && !(jsonObj.domainid == g_domainid && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id)) //if neither root-admin, nor the same account, nor the same project |
1464 | 1464 | if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account)) //if neither root-admin, nor item owner |
1465 | 1465 | || jsonObj.isready == false) |
1466 | 1466 | || (jsonObj.bootable == false) |
|
1475 | 1475 |
|
1476 | 1476 | // "Download ISO" |
1477 | 1477 | //if (((isUser() && jsonObj.ispublic == true && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) |
1478 | | - if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account))) //if neither root-admin, nor item owner |
| 1478 | + if (((isAdmin() == false && !(jsonObj.domainid == g_domainid && jsonObj.account == g_account) && !(jsonObj.domainid == g_domainid && cloudStack.context.projects && jsonObj.projectid == cloudStack.context.projects[0].id))) //if neither root-admin, nor the same account, nor the same project |
1479 | 1479 | || (jsonObj.isready == false) |
1480 | 1480 | || (jsonObj.domainid == 1 && jsonObj.account == "system") |
1481 | 1481 | ) { |
|
0 commit comments