public static List<StringOption> getUserSubTenantOptions() { List<StringOption> options = Lists.newArrayList(); if (Security.hasAnyRole( Security.SECURITY_ADMIN, Security.RESTRICTED_SECURITY_ADMIN, Security.HOME_TENANT_ADMIN)) { TenantOrgRestRep userTenant = getViprClient().tenants().get(uri(Security.getUserInfo().getTenant())); options.add(createTenantOption(userTenant)); } for (TenantOrgRestRep tenant : getViprClient().tenants().getByIds(Security.getUserInfo().getSubTenants())) { options.add(createTenantOption(tenant)); } return options; }
public static boolean canReadAllTenants() { return Security.hasAnyRole( Security.ROOT_TENANT_ADMIN, Security.SECURITY_ADMIN, Security.SYSTEM_MONITOR); }
public boolean canEditVcenter() { if (Security.isSecurityAdmin() && !(Security.isSystemAdmin() || Security.isTenantAdmin() || isNew())) { return false; } return true; }
/** * Checks to see if setup is complete, and it not locks out non-admin users by redirecting to a * static page instead of showing a forbidden error. */ private static void checkCompleteAndLicensed() { // If setup is complete, redirect if (isInitialSetupComplete() && isLicensed()) { complete(); } // If this user does not have the right roles, redirect to a static page if (Security.isSystemAdminOrRestrictedSystemAdmin() == false && Security.isSecurityAdminOrRestrictedSecurityAdmin() == false) { notLicensed(); } if (!Common.isClusterStable()) { Maintenance.maintenance(request.url); } }
public static List<StringOption> getSubTenantOptions() { List<StringOption> options = Lists.newArrayList(); TenantOrgRestRep userTenant = getViprClient().tenants().get(uri(Security.getUserInfo().getTenant())); options.add(createTenantOption(userTenant)); for (TenantOrgRestRep tenant : getViprClient().tenants().getAllSubtenants(uri(Security.getUserInfo().getTenant()))) { options.add(createTenantOption(tenant)); } Collections.sort(options); return options; }
protected Task<VcenterRestRep> createVCenter(boolean validateConnection) { VcenterCreateParam vcenterCreateParam = new VcenterCreateParam(); doWriteTo(vcenterCreateParam); if (Security.isSystemAdmin()) { return VCenterUtils.createVCenter( vcenterCreateParam, validateConnection, getAclAssignmentChanges()); } return VCenterUtils.createVCenter( TenantUtils.getTenantFilter(Models.currentAdminTenantForVcenter()), vcenterCreateParam, validateConnection); }
@Override public UserGroupInfo performOperation(UserGroupRestRep userGroupRestRep) throws Exception { return new UserGroupInfo(userGroupRestRep, Security.isSecurityAdmin()); }
public static TenantOrgRestRep getUserTenant() { return getViprClient().tenants().get(uri(Security.getUserInfo().getTenant())); }