# App that uses some kind of "sharing"

**URL:** <https://forum.adalo.com/t/app-that-uses-some-kind-of-sharing/12833>\
**Category:** Get Help\
**Created:** [May 21, 2021, 8:41pm UTC](https://forum.adalo.com/t/app-that-uses-some-kind-of-sharing/12833 "2021-05-21T20:41:35Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![dnmg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dnmg/32/8504_2.png) [@dnmg](https://forum.adalo.com/u/dnmg)\
**Post date:** [May 21, 2021, 8:41pm UTC](https://forum.adalo.com/t/app-that-uses-some-kind-of-sharing/12833/1 "2021-05-21T20:41:35Z")

</div>

Hi adalo experts ![🙂](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/1/16ef434fe241f284ea479614faf290dbad8afcbc.png) pls we need help ![🙏](https://us1.discourse-cdn.com/flex020/uploads/adalo/original/2X/7/746dbf45fbe7fd6267d4e73d5e8dc1f86e2077a4.png)

we are facing an issue. We would like to build an app that uses some kind of “sharing”. So users can manage multiple database objects with different type of permissions. I’ll give an example.

There is Joe who is owner of Company A and employee of Company B. Then there is Dave who is owner of Company B.

Let’s say we have database collection called “Companies”. Usually (in normal database) there would be table with these rows (very simple):

ID, company name

1, Company A,

2, Company B

Users table:

ID, user name

1, Joe

2, Dave

Then there would be table Company\_data:

ID, Company\_ID, user\_id, permissions

1, 1, 1, owner

2, 2, 1, employee

3, 2, 2, owner

There also table events:

ID, event name, company\_id, date

1, Dinner at Hotel, 2, 27-12-2021 21:45

Now we don’t know how to build that. Second issue is that user can only see 1 company at a time AND can / cannot edit data based on permissions (which owner can change).

---

<div class="post-metadata">

**Author:** ![Erik](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/erik/32/7849_2.png) [@Erik](https://forum.adalo.com/u/Erik)\
**Post date:** [May 21, 2021, 8:47pm UTC](https://forum.adalo.com/t/app-that-uses-some-kind-of-sharing/12833/2 "2021-05-21T20:47:17Z")

</div>

What’s the use case for this? So you can add multiple people to a bill?

I don’t understand why Joe is an owner of a company but an employee of another company.

You could have organizations and allow users to be a part of multiple orgs, then have a role collection with role type, user, org.

I’m trying to understand what you want to achieve here though because I think there’s a better way to achieve this without doing it the way you mentioned.

---

<div class="post-metadata">

**Author:** ![dnmg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dnmg/32/8504_2.png) [@dnmg](https://forum.adalo.com/u/dnmg)\
**Post date:** [May 21, 2021, 8:57pm UTC](https://forum.adalo.com/t/app-that-uses-some-kind-of-sharing/12833/3 "2021-05-21T20:57:36Z")

</div>

Well, we tried to make it universal from description point of view. Points is that the app has “projects”. These projects have multiple users with different type of permissions (some users can only view data, some can edit them).  
And the projects (aka companies in our example), have other collections bounds to it. Like project can have “events” 1 project : N events … or budgets (once again, 1:N) … and then e.g. budgets can have expenses (1 budget : N expenses).

---

<div class="post-metadata">

**Author:** ![Erik](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/erik/32/7849_2.png) [@Erik](https://forum.adalo.com/u/Erik)\
**Post date:** [May 21, 2021, 9:18pm UTC](https://forum.adalo.com/t/app-that-uses-some-kind-of-sharing/12833/4 "2021-05-21T21:18:37Z")

</div>

Okay, you have to be pretty specific with your requests because it’s tech - there are a lot of different ways to accomplish the same thing, some better than others.

For this, I’d do the following:

1. Users can create a project. When they create a project, they create a referral code. This gives users the ability to join the project (without the project being visible to everyone).
2. All users have some functionality to join a project by entering the referral code. You can use this for reference - [Adalo Referral Code Tutorial - YouTube](https://www.youtube.com/watch?v=nZssgu0PCiA)
3. When the user joins the project, have an admin approve them and assign rights (edit y/n). This is half of that process - [Creating a User Approval Process in Adalo - YouTube](https://www.youtube.com/watch?v=cbcyz9qRvxQ)
4. Filter all edit button visibility to only be visible to if logged in user has edit rights to current project.

If you only have 2 access levels - edit, read only, then all the better. You can use binary features for that (edit y/n) and make edit only visible to yes. If you have N\>2 states, then you’ll need to think about adding roles rule engine.

Hope that helps.

---

<div class="post-metadata">

**Author:** ![dnmg](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/dnmg/32/8504_2.png) [@dnmg](https://forum.adalo.com/u/dnmg)\
**Post date:** [May 24, 2021, 9:14am UTC](https://forum.adalo.com/t/app-that-uses-some-kind-of-sharing/12833/5 "2021-05-24T09:14:57Z")

</div>

Hi Erik,  
thanks for helping, probably we can do it like you sad…

---

<div class="post-metadata">

**Author:** ![system](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.adalo.com/system/32/40401_2.png) [@system](https://forum.adalo.com/u/system)\
**Post date:** [June 3, 2021, 9:15am UTC](https://forum.adalo.com/t/app-that-uses-some-kind-of-sharing/12833/6 "2021-06-03T09:15:42Z")

</div>

Closed on June 3, 2021, 9:15am UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
