Deliver a solution to a customer
A quick build is for you, the Tenant Administrator. It has no customers, roles, or users. When a customer must see the data, tell the agent to add them. The agent adds the customer, the roles, and the users, and makes one dashboard for each role. This guide shows how.
What you need before you start
Section titled “What you need before you start”- A project folder with a working profile. See Getting Started.
- A solution in the project. In this guide, the solution is
office-climate, a quick build of the office sensor from Getting Started.
Add a customer, roles, and users
Section titled “Add a customer, roles, and users”-
Start the agent in the project folder.
-
Send a prompt that names the customer and the roles:
In office-climate, add the customer Acme Offices. Add two roles for Acme: an operator who can acknowledge and clear alarms, and a viewer who can only look. Add one user for each role. -
If the agent asks Just these items, or full solution treatment?, select Full solution treatment. A new role changes the dashboards, so the agent must see the full design.
-
Check the plan. The agent shows the changes and asks Does this plan look right? Select Approve and apply, or select Revise the plan and describe the change.
The agent then writes the files. Each step is a git commit.
-
Answer the deploy question. Select Deploy only, Deploy and stream live data to see live values, or Not now to deploy later. After a deployment, the agent shows the dashboard links.
To make more changes later, describe them in the same way. The agent changes only what is affected and keeps the IDs of the existing entities.
What the agent changes
Section titled “What the agent changes”A quick build uses the built-in Tenant Administrator. When you add the first customer, user group, or role, the agent writes the full role design:
| Part | What the agent does |
|---|---|
| Customers | Adds a customer entity for each customer that you name. |
| Roles | Adds one tenant-level administrator role with full access (CRUD), and the roles that you asked for. An operator role usually gets read and update access (RU). A view-only role gets read access (R). |
| User groups | Adds one user group for each role. A customer-level user group belongs to the customer. |
| Users | Adds one user for each role, unless you ask for more. |
| Entity groups | Adds the groups that connect the roles to the devices, assets, and dashboards. |
| Dashboards | Moves the existing dashboard to the new administrator role. It keeps its screens. Each other role gets its own dashboard. |
The agent never makes a second administrator dashboard. Your first dashboard becomes the administrator dashboard.
A customer-level dashboard opens on the customer’s own data. The agent adds management actions only for roles whose permissions allow them. A view-only role gets no actions.
The existing devices move to the new customer: the agent changes their owner and does not add new demo devices. After the push, the devices appear under the customer in ThingsBoard.
Review the design files
Section titled “Review the design files”The agent records the design in the design/ folder of the solution. Push ignores this folder. Open these files to check the result before you deploy:
design/architecture-overview.md: The Customer Groups table lists the customers. The User Groups and Roles table lists each role with its scope (Tenantor the customer) and its permissions (CRUD,RU, orR).design/dashboards.json: Each dashboard has anassignedTofield with the role that uses it.
To change the design, tell the agent what is wrong, like this:
The viewer must not see the alarm table. Remove it from the viewer dashboard.Deploy the changes
Section titled “Deploy the changes”If you selected Not now at the deploy question, deploy later from the project folder:
tb push office-climate --run-tasksThe command creates the new entities and updates the existing ones. It does not duplicate entities. When it completes, it shows the dashboard links.
Let a customer user sign in
Section titled “Let a customer user sign in”The agent gives each user a demo email address, like anna.smith@acme-offices.com. Nobody can receive mail at this address. To give a real person access, tell the agent the real address before you deploy:
In office-climate, change the email of the Acme operator user to jane@acme.com.After the deploy, activate the user in ThingsBoard:
-
Go to Customers & users > Users and open the user.
-
Click Display activation link, copy the link, and send it to the person. Or click Resend activation to send the link by mail. Mail needs a configured mail server.
-
Tell the person to open the link and create a password.
The person can now sign in. They see only the entities of their customer and the dashboards of their role.
To check what a role sees, open the user and click Login as Customer User. For details, see these platform pages:
- Users: user activation and Login as a user.
- Customers: customer users and customer resources.
- Role-based access control: roles, user groups, and group permissions.
Next steps
Section titled “Next steps”- Environments and CI: test on staging before the customer sees the change.
- Example: smart retail solution: the full design flow with approval at each step.
Was this helpful?