@Test public void testGetCurrentTenantId() throws Exception { MultiTenantHelper.getCurrentTenantId(new SystemPrincipal("nobody")); }
public static String getCurrentTenantId(Principal principal) { if (principal instanceof SystemPrincipal) { String originatingUser = ((SystemPrincipal) principal).getOriginatingUser(); if (originatingUser != null) { return getTenantId(originatingUser); } else { return null; } } else { return NuxeoPrincipal.getCurrent().getTenantId(); } }
MultiTenantHelper { public static String getCurrentTenantId(Principal principal) { if (principal instanceof SystemPrincipal) { String originatingUser = ((SystemPrincipal) principal).getOriginatingUser(); if (originatingUser != null) { return getTenantId(originatingUser); } else { return null; } } else { return NuxeoPrincipal.getCurrent().getTenantId(); } } }
MultiTenantHelper { public static String getCurrentTenantId(Principal principal) { if (principal instanceof SystemPrincipal) { String originatingUser = ((SystemPrincipal) principal).getOriginatingUser(); if (originatingUser != null) { return getTenantId(originatingUser); } else { return null; } } else { return NuxeoPrincipal.getCurrent().getTenantId(); } } private  MultiTenantHelper(); }
MultiTenantHelper { public static String getCurrentTenantId(Principal principal) { if (principal instanceof SystemPrincipal) { String originatingUser = ((SystemPrincipal) principal).getOriginatingUser(); if (originatingUser != null) { return getTenantId(originatingUser); } else { return null; } } else { return NuxeoPrincipal.getCurrent().getTenantId(); } } private  MultiTenantHelper(); static String computeTenantAdministratorsGroup(String tenantId); static String computeTenantMembersGroup(String tenantId); static String getCurrentTenantId(Principal principal); static String getTenantId(String username); static String getTenantDocumentPath(CoreSession session, final String tenantId); static String getOwningTenantId(final DocumentModel doc); }
MultiTenantHelper { public static String getCurrentTenantId(Principal principal) { if (principal instanceof SystemPrincipal) { String originatingUser = ((SystemPrincipal) principal).getOriginatingUser(); if (originatingUser != null) { return getTenantId(originatingUser); } else { return null; } } else { return NuxeoPrincipal.getCurrent().getTenantId(); } } private  MultiTenantHelper(); static String computeTenantAdministratorsGroup(String tenantId); static String computeTenantMembersGroup(String tenantId); static String getCurrentTenantId(Principal principal); static String getTenantId(String username); static String getTenantDocumentPath(CoreSession session, final String tenantId); static String getOwningTenantId(final DocumentModel doc);  }