I have a list of organizations, and a list of users. A user can be assigned to multiple organizations, and have multiple roles within that organization.
For example, Bob can be a member of Ford and Toyota.
At Ford Bob’s role is Billing and Project Management.
At Toyota Bob’s role is Project Management and HR.
Right now I have a user field that is a list of roles for the user. The issue is that the user roles apply universally to all organizations. So in the example above, because Bob has been assigned the Billing role at Ford, he is automatically being given those permissions at Toyota.
I’m thinking I need to restructure the database so each role type is a list of users in the org data type. So for example
Organization
Billing Role (list of users)
Project Management (list of users)
HR (list of users)
I’d like the manager of the organization to be able to view the user and set the roles in a single field like this: Zight 2025-3-27 at 11.13.24 AM
Maybe I need a permissions data type to store the permissions each user has at each organization?
For any future readers looking to solve a similar problem, I ended up having to create a permissions field (list of users) in the Organization Data Type for the different levels of permission I wanted to set, combined with a Permissions table.
I probably could have gotten away with just using the permission field and creating some feature to add users to the correct permission field from within the organization.
For example, I could have just used a multi-select dropdown field for ADMINs and a multi-select dropdown for USERs.
At this point I’ve already built the permissions table so…whatever. I’m keeping it and it’s kinda cool. Next time I would try it without and see what happens.