amplify-swift
amplify-swift copied to clipboard
Multiple auth rules for multi owners
Is your feature request related to a problem? Please describe.
The documentation allows for multiple owners of a model, buth the Amplify iOS implementation is lacking this important feature.
Describe the solution you'd like
There is already some work on this, but it has been stalled for almost a year: https://github.com/aws-amplify/amplify-ios/pull/1606
Describe alternatives you've considered
The alternative is to not share data between users, but this is hardly a solution.
Is the feature request related to any of the existing Amplify categories?
DataStore
Additional context
No response
Thanks for opening this @askemottelson. We'll investigate the status of https://github.com/aws-amplify/amplify-ios/pull/1606 respond back to this issue with any updates.
Hi @atierian and @lawmicha - thanks for looking into this. I just noticed that remote DataStore real time events are also not triggered for multi auth models (i.e., only local events are fired when listening on Amplify.DataStore.observeQuery). This is a critical bug, as an app with shared data access will have to continuously and manually check for DataStore updates (actually not even sure even that works without restarting DataStore). This is the case for a model of this type:
type DataModel
@model
@auth(rules: [
{allow: owner, ownerField: "owner"},
{allow: owner, ownerField: "secondaryOwners", operations: [update, read, create, delete]}
{allow: private, operations: [create]}
]) {
id: ID!
owner: String!
secondaryOwners: [String]
}
@atierian any news on this? Seems like a pretty big deal that Amplify iOS does not support data sharing across users?
any update on this? @atierian
Hello! Someone has a workaround on how to share data across users with Amplify iOS? Thank you!
Hello! Someone has a workaround on how to share data across users with Amplify iOS? Thank you!
I'm afraid not. We are still eagerly waiting for support for multi users, and receiving data update events in real time.
any update on this please ... we wait a long time for it ? @atierian
This was released in https://github.com/aws-amplify/amplify-swift/releases/tag/2.19.0
Closing since this has been released. Feel free to open another issue with the relevant schema if something isn't working as expected in Amplify 2.19.0