cancel
Showing results for 
Search instead for 
Did you mean: 

Multi Tenant programmatically add tenant administrators

Bauke_Roo
Star Contributor
Star Contributor

Hi There,

How can I programmatically add tenant Administrators?

I'm currently trying this:

String query = String.format(
                "SELECT * FROM Document WHERE tenantconfig:tenantId = '%s'",
                tenantId);
        List<DocumentModel> docs = session.query(query);
        if (!docs.isEmpty()) {
            DocumentModel tenant = docs.get(0);
            List<String> tenantAdministrators = (List<String>) tenant.getPropertyValue(TENANT_ADMINISTRATORS_PROPERTY);
            tenantAdministrators.add("some username");
            tenant.setProperty("tenantconfig","administrators", tenantAdministrators); 
        }

But this does not seem to work.

Thanks in advance, Bauke Roo

2 REPLIES 2

Bauke_Roo
Star Contributor
Star Contributor

It seems to be still early in the morning...

It is needed to save the document after changing the property 🙂

session.saveDocument(tenant);
session.save();

Bauke Roo

Bhagat__Singh
Champ in-the-making
Champ in-the-making

hi ,

i am developing a small application to handle multi domain as Multi Tenant , i am able to see the changes or List of Tenant in the Nuxeo ui but i am developing the application using angular 8 as a frontend and middleware is java spring boot api which is implementing the java client sdk of nuxeo . but i did not find any class or methods in java client sdk which gives me the Multi tenant manipulation like

  • fetch the list of Tenant
  • fetch the Tenant administrator group
  • member group
  • assignin the administrator to the Tenant Could any one help men in this

thanks Bhagat Singh

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.