public class MultiTenantHelper extends Object
Modifier and Type | Method and Description |
---|---|
static String |
computeTenantAdministratorsGroup(String tenantId) |
static String |
computeTenantMembersGroup(String tenantId) |
static String |
getCurrentTenantId(Principal principal)
Returns the current tenantId for the given
principal , or from the
principal stored in the login stack. |
static String |
getTenantDocumentPath(CoreSession session,
String tenantId)
Returns the path of the tenant document matching the
tenantId , or
null if there is no document matching. |
static String |
getTenantId(String username)
Returns the tenantId for the given
username if any, null
otherwise. |
public static String computeTenantAdministratorsGroup(String tenantId)
public static String getCurrentTenantId(Principal principal) throws ClientException
principal
, or from the
principal stored in the login stack.
The principal
is used if it is a SystemPrincipal
, then
the tenantId is retrieved from the Principal matching the
SystemPrincipal.getOriginatingUser()
.
ClientException
public static String getTenantId(String username) throws ClientException
username
if any, null
otherwise.ClientException
public static String getTenantDocumentPath(CoreSession session, String tenantId) throws ClientException
tenantId
, or
null
if there is no document matching.ClientException
Copyright © 2013 Nuxeo SA. All Rights Reserved.