DEV Community 👩‍💻👨‍💻

Discussion on: The guide to create (offline) multi tenant apps with Expo and AWS Amplify

Collapse
 
devtghosh profile image
Devjyoti Ghosh

Hey is there a way I could share access for a model with users outside the tenant? My use case would be a user group that can have access to models from various tenants. For eg in asana a user can be added to various different companies projects.

Collapse
 
rpostulart profile image
rpostulart Author

I believe it should be possible, but then you need to add multiple tenantid's to cognito userattribute. For example an array or string with commas as seperators. In your application you can to the validation

Collapse
 
devtghosh profile image
Devjyoti Ghosh • Edited on

I don't think this works exactly. Because user needs to have access to specific projects within a company. With multiple tenant ids 2 users within the same user group will have access to all projects within the tenant that is shared to the user group. See the image for an example of what is needed. dev-to-uploads.s3.amazonaws.com/i/...

Thread Thread
 
rpostulart profile image
rpostulart Author

You can use the user attribute (tenant) in combination with cognito groups (projects) or create multiple user attributes

Thread Thread
 
devtghosh profile image
Devjyoti Ghosh • Edited on

I don't think that works because you can only have 500 cognito user groups and users will need to have access to specific projects so each project's access will need their own cognito group I think. I have updated the user access diagram maybe that will make it more clear user access pattern diagram

There can also be a user 3 in above diagram that is a freelancer in both Company 1 & 2 and has access to only project A & C

Thread Thread
 
jcastaneyra profile image
Jose Castaneyra

The number of Cognito groups now is 10,000.

And a user can belong to 100 groups.

docs.aws.amazon.com/cognito/latest...