コード例 #1
3
  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;
  }
コード例 #2
2
 public static boolean canReadAllTenants() {
   return Security.hasAnyRole(
       Security.ROOT_TENANT_ADMIN, Security.SECURITY_ADMIN, Security.SYSTEM_MONITOR);
 }
コード例 #3
0
 public boolean canEditVcenter() {
   if (Security.isSecurityAdmin()
       && !(Security.isSystemAdmin() || Security.isTenantAdmin() || isNew())) {
     return false;
   }
   return true;
 }
コード例 #4
0
 /**
  * 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);
   }
 }
コード例 #5
0
  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;
  }
コード例 #6
0
    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);
    }
コード例 #7
0
 @Override
 public UserGroupInfo performOperation(UserGroupRestRep userGroupRestRep) throws Exception {
   return new UserGroupInfo(userGroupRestRep, Security.isSecurityAdmin());
 }
コード例 #8
0
 public static TenantOrgRestRep getUserTenant() {
   return getViprClient().tenants().get(uri(Security.getUserInfo().getTenant()));
 }