Hi there! I have an app that’s used by multiple companies, each company can have 1 to n users. I want to secure the companies’ data better so that all users of the companies only download the data of that company. However, therefore row owners need to be managed dynamically. E.g. everytime a user is added to a company, he/she becomes a row owner for all records of that company.
However, given that a calculated column can’t be made a rown owner (I could create a lookup column for each records which look ups the related mails for a company), I am stuck.
A solution would be that you could define that the ‘row owners’ functionality shouldn’t use the user email as a differentiator but rather a column in the user table with for example a company name. However, I don’t think that this functionality exists in Glide atm.
You could do that with Roles. If you assign the role ‘Company A’ then everyone with the role ‘Company A’ would own that row.
You just need to add ‘Company A’ to the row you are trying to secure. It would be the same process as adding the users email to own that row.
FYI once you assign a role to a user, you can’t change his/ her role via Glide anymore. You’d have to implement a 3rd party like Make to change users established roles.
Thanks for the fast answer! Seems like a cool solution!
I have three more questions:
1 - So you’d have to make an API call through Make to change the user Rol through the front end instead of the backend? Gotcha!
2 - If a want to add more than one company (=role) to a user, it says to use an ‘array column’ as the role column in the user table. Which type of column is that in Glide (it seems to come from Google Sheet)? Or can I just use a text column, comma separated…?
3 - Finally, this is the first time I really work with row owners (because this is an app for multiple companies). Does using row owners positively impact performance? E.g., now that a user only downloads his/her rows (and computed columns only have to be generated for those columns), can I say that the database limit now is 25000 rows per user instead as for the application as a whole? Or doesn’t it work like that (as in the backend Glide Edit screen, you still have to load all data) (I know that you can use ‘big tables’ but there are some limitations to big tables)
An array of roles is only possible if you are using GSheet for your Users table. You can achieve that in GSheet by labeling sequential columns like so… role 1, role 2, role 3, etc…
Depending on your case you could build a hierarchy of roles. ‘Group 1’ could be the owner of many companies. ‘Group 1’ could be representative of three other roles… Company A, Company B and Company C for example.
I’m not sure if Glide will count all the rows against you but the app should function. It will really depend on the complexity of your app. In a simple app if you had 1M rows… and 1M users each owned 1 row… then that should work.
When you use row owners the number of rows downloaded by a user is limited to the number of rows owned by that user. The ‘un owned’ rows are never sent to the users device in the first place. (That’s also what makes row owners secure )