I wasn’t sure how to go about limiting the
data that each user can see. Can you show me how to find more about
using the data roles? How do you assign a data role to a user?
What I’m trying to do:
Create an app where users belong to a company managed by an admin. The
relevant data to each company can only be seen if you belong to the
company.
How I was going about it:
a) create a company data type. Include a company element on each of the
other data types (orders, products, clients). I was going to create
pages and repeating groups that only list the data if there is a match
between the company of the user and the company of the element.
b) somehow create a data role for each data type that would limit
everyones ability to see data if there is not a match between the
company of the user and the company of the element
Thanks,
Yes, that’s the right approach. You can create a role for the company data type and the condition would be ‘current user’s company is this company data’s company’.
Have you tried playing with it? I would do this once you have data though, it’s easier to test
Hello,
I am trying to do something similar but not quite the same and I am puzzled by the real use of the data roles (more tutorial, explanation please!).
What I want to do is having users with different access rules. User Type has a “type” field that can be “employee, manager, admin, etc…”.
Then in another Data type (ex: “Projects”) I want that only Managers can see all the projects. I was thinking to insert in the Data roles the rule
when: Current User’s type contains "Manager"
but the last word I cannot insert as a “constant” and I have only the option to write “This project” or “Current user”.
Any advise?
Thanks
Sergio
In the end I did not use the data roles part of bubble. Perhaps someone who has played with the data roles can answer this better. How I went about it is to restrict what people can and cannot see at the level of the show/hide rules if you were trying to hide nagivation icons or even workflow buttons from certain users. I have also created didfferent search parameters based on what the users “type” is. This can be done if you have a repeating group and you go to the conditions tab. Then you can add logic that would say, if users type is “______” (here you can add contants for text" and then apply different search parameters or show and hide rules depending on what you want to be done.
Another level of selecting data for different groups is to put “types” on each data as well. For example on all your projects you can have a list of users that are privy to that project. Then in your search parameters that you would like “all projects that include current user as a viewer”. There are different ways to do it but its best to sort it out early because as your data set grows it can be hard to go back and add users and fields to old datasets. Plus you’ve then got to remember to add or remove users from the projects as they add or remove their roles and accounts. Not easy but doable!