@Test public void testGetTenantId() throws Exception { MultiTenantHelper.getTenantId("nobody"); }
public static String getTenantId(String username) { UserManager userManager = Framework.getService(UserManager.class); String tenantId = null; DocumentModel userModel = userManager.getUserModel(username); if (userModel != null) { tenantId = (String) userModel.getPropertyValue("user:tenantId"); } return tenantId; }
MultiTenantHelper { public static String getTenantId(String username) { UserManager userManager = Framework.getService(UserManager.class); String tenantId = null; DocumentModel userModel = userManager.getUserModel(username); if (userModel != null) { tenantId = (String) userModel.getPropertyValue("user:tenantId"); } return tenantId; } }
MultiTenantHelper { public static String getTenantId(String username) { UserManager userManager = Framework.getService(UserManager.class); String tenantId = null; DocumentModel userModel = userManager.getUserModel(username); if (userModel != null) { tenantId = (String) userModel.getPropertyValue("user:tenantId"); } return tenantId; } private  MultiTenantHelper(); }
MultiTenantHelper { public static String getTenantId(String username) { UserManager userManager = Framework.getService(UserManager.class); String tenantId = null; DocumentModel userModel = userManager.getUserModel(username); if (userModel != null) { tenantId = (String) userModel.getPropertyValue("user:tenantId"); } return tenantId; } 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 getTenantId(String username) { UserManager userManager = Framework.getService(UserManager.class); String tenantId = null; DocumentModel userModel = userManager.getUserModel(username); if (userModel != null) { tenantId = (String) userModel.getPropertyValue("user:tenantId"); } return tenantId; } 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);  }