Hello everybody!
Is it possible/suitable to create SaaS app with CUBA?
For example — we need to create a web application, which should help to handle customers orders. Something like typical web-shop backend.
Basic entities are:
Client - a company, our client
Client Manager - users, client’s staff (managers)
Items - goods
Order - customer’s Order
Each Client/client managers shoud read/write only their own items/orders.
So, Items and Orders are belong to Client, as well as Client Managers.
One of client managers (admin) should have permission to create other client managers for their company (Client entity).
Example above is simplified, just to help to describe an idea.
What do you think, should we try CUBA for this task? How it could be implemented?
How can I make that how Administrator can create records what every uses sees?
And I already had datas in database when I needed to make these changes. How to make these datas to be available to a user?
> How can I make that how Administrator can create records what every uses sees?
Change constraint for the entity to
{E}.client = :session$client_id or {E}.client is null
If you want all records created by admin to be accessible by all clients, just change the init() method in StandardClientEntity. Otherwise, you can make the “client” attribute accessible in UI and give permission to see and change it to admin’s role.
> And I already had datas in database when I needed to make these changes. How to make these datas to be available to a user?
If I correctly understand your question, you need to add the CLIENT column and update rows to set appropriate values.
{E}.client = :session$client_id or {E}.client is null
not works… I did not updated these datas yet.
If I change Constraints Is Active to unchecked, then client user sees the datas which created by admin, but with that condition, user sees only his own records…
Any idea?