Back

Is it possible to have Access Control hierachly in appwrite

  • 0
  • Teams
  • Tools
  • Accounts
  • Self Hosted
  • Users
Suiii
20 Aug, 2023, 13:35

How can I archive the access control algorithm or helper below conditions.

Here below is the scenario.

It should be like this.

User1A, 1B, 1C have Manager UserM1

User2A, 2B have Manager UserM2

User3A has Manager UserM3

UserM1 has Manager UserMM1

UserM2,M3 has Manager UserMM2

UserMM1, UserMM2 has Manager UserMMM

UserMMM can have its Manager as well and so and so.

Note: Recursive relationship of User and User's Manager could be deep up to 10 levels.

Each users will have access to many customers.

So technically, any customers assigned to the any user, the user will be able to see, And, their manager can see those customers too. Ofc, the manager of that manager will be able to see too. And the next level manager is the same.

======= Additional explanation ========

I have 10 clients = I can only view 10 clients

Pogba have 5 clients = He can view 5 clients.

Paul is my manager and he also has 5 clients = He can view 15 clients

Logan is Pual Manager and he also has 10 clients = He can view 25 clients (Me, Paul, and Logan clients)

Henry is Pogba and Logan Manager = He can view 30 clients (25 client from Logan and Logan's staff + 5 clients from Pogba )

so and so.

Thanks

TL;DR
The user wants to know if it's possible to have hierarchical access control in Appwrite. They want to know how to manage teams with thousands of users and how managers can access their staff and customers. The user provides a scenario with multiple levels of managers and users. Solution: The user can achieve this by using Appwrite teams to group permissions. They can create a collection for users, with a document for each user. The user should assign the necessary roles and managers to each user, ensuring that the recursive relationship of user and manager is set up to their desired depth.
D5
20 Aug, 2023, 14:03

So basically the latest (additional) explanation can be achieved easily with Appwrte teams (you group permissions). I recommend creating an users collection with a document for each user

Suiii
20 Aug, 2023, 15:30

How manager access his staffs , his staffs of staffs and ….. customers ?

Suiii
20 Aug, 2023, 15:30

Can you give me more explanation

D5
21 Aug, 2023, 09:10

When creating the document, you give permission to X team and X role have access to such document, read, delete, etc

Suiii
22 Aug, 2023, 14:08

User A has manager User B

Suiii
22 Aug, 2023, 14:09

User B has manager User C

Suiii
22 Aug, 2023, 14:09

User C has manager User D

Suiii
22 Aug, 2023, 14:09

User A1 has manager User B1,

Suiii
22 Aug, 2023, 14:09

User B1 has manager User C1

Suiii
22 Aug, 2023, 14:09

So and so on

Suiii
22 Aug, 2023, 14:10

How can we manage team when we have thousand of users

D5
22 Aug, 2023, 15:32

User A is in team A with role user. User B is in team A with role manager

D5
22 Aug, 2023, 15:33

Same with the remaining ones

Suiii
23 Aug, 2023, 08:45

but User B (manager) can have many other users (role user)

Suiii
23 Aug, 2023, 08:45

User B can have one Manager too.

D5
23 Aug, 2023, 08:51

In the same team?

Suiii
23 Aug, 2023, 10:08

can be same team, can be another team

D5
23 Aug, 2023, 10:16

Then add a superior role

Suiii
23 Aug, 2023, 11:48

the level of manager can be up to 10 levels

Suiii
23 Aug, 2023, 11:49

can you show me abit

D5
23 Aug, 2023, 14:01

As said, just make groups with roles and done

Suiii
23 Aug, 2023, 14:07

okay thank you

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more