amplify-swift icon indicating copy to clipboard operation
amplify-swift copied to clipboard

Multiple auth rules for multi owners

Open askemottelson opened this issue 3 years ago • 1 comments

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

askemottelson avatar Sep 12 '22 09:09 askemottelson

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.

atierian avatar Sep 20 '22 13:09 atierian

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] 
}

askemottelson avatar Oct 12 '22 09:10 askemottelson

@atierian any news on this? Seems like a pretty big deal that Amplify iOS does not support data sharing across users?

askemottelson avatar Oct 19 '22 07:10 askemottelson

any update on this? @atierian

pixelier avatar Nov 19 '22 23:11 pixelier

Hello! Someone has a workaround on how to share data across users with Amplify iOS? Thank you!

siecola avatar Jan 25 '23 10:01 siecola

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.

askemottelson avatar Jan 25 '23 18:01 askemottelson

any update on this please ... we wait a long time for it ? @atierian

marmll41 avatar May 08 '23 12:05 marmll41

This was released in https://github.com/aws-amplify/amplify-swift/releases/tag/2.19.0

lawmicha avatar Sep 29 '23 18:09 lawmicha

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

lawmicha avatar Oct 02 '23 16:10 lawmicha