private boolean userTenantHasPermissionForVirtualPool(String vpoolId){
  VirtualPool vpool=_dbClient.queryObject(VirtualPool.class,URI.create(vpoolId));
  if (vpool == null) {
    _log.error("VirtualPool {} could not be found in the database",vpoolId);
    return false;
  }
  StorageOSUser user=getUserFromContext();
  URI tenantURI=URI.create(user.getTenantId());
  if (_permissionsHelper.tenantHasUsageACL(tenantURI,vpool)) {
    _log.debug("Home tenant {} has usage ACL for VirtualPool {}",tenantURI,vpoolId);
    return true;
  }
  for (  String subtenantId : _permissionsHelper.getSubtenantsForUser(user)) {
    if (_permissionsHelper.tenantHasUsageACL(URI.create(subtenantId),vpool)) {
      _log.debug("Subtenant {} has usage ACL for VirtualPool {}",tenantURI,vpoolId);
      return true;
    }
  }
  return false;
}

private boolean userTenantHasPermissionForVirtualPool ( String vpoolId ) { VirtualPool vpool = _dbClient . queryObject ( VirtualPool . class , URI . create ( vpoolId ) ) ; if ( vpool == null ) { _log . error ( "VirtualPool {} could not be found in the database" , vpoolId ) ; return false ; } StorageOSUser user = getUserFromContext ( ) ; URI tenantURI = URI . create ( user . getTenantId ( ) ) ; if ( _permissionsHelper . tenantHasUsageACL ( tenantURI , vpool ) ) { _log . debug ( "Home tenant {} has usage ACL for VirtualPool {}" , tenantURI , vpoolId ) ; return true ; } for ( String subtenantId : _permissionsHelper . getSubtenantsForUser ( user ) ) { if ( _permissionsHelper . tenantHasUsageACL ( URI . create ( subtenantId ) , vpool ) ) { _log . debug ( "Subtenant {} has usage ACL for VirtualPool {}" , tenantURI , vpoolId ) ; return true ; } } return false ; }
determines if the virtualpool with the passed id is accessible to the user ' s tenant ( includes the subtenants user has tenantadmin role ) .
