You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Looking at com.amplifyframework.api.aws.AWSApiPlugin#isOwnerArgumentRequired it seems out of place that we are checking ModelOperation before passing ownerField in our subscription request.
Correct me if wrong but i don't think a user needs CREATE, UPDATE, DELETE, perms to be able to receive ON_CREATE, ON_UPDATE, ON_DELETE subscriptions. I don't have to give a user UPDATE permission to my api for them to be notified of an update made to a record they observe.
amplify cli still build the subscriptions with the owner field... (will send examples shortly)
take this model definition as an example:
type Share
@model
@auth(
rules: [
{ allow: groups, groups: ["ForbiddenGroup"] }
{ allow: owner, ownerField: "accessUsers", operations: [read] }
{ allow: private, provider: iam }
]
)
{
id: ID!
accessUsers: [String!]! # users that have access to the record
}
Thanks for reporting this @saltonmassally ! I believe your understanding is accurate. I'm going to resolve this issue, as I think it is a duplicate of #699, but I will take a look at your PR shortly as well. Before we finalize this change, we need to make sure iOS and JS are in sync with this logic as well.
Looking at com.amplifyframework.api.aws.AWSApiPlugin#isOwnerArgumentRequired it seems out of place that we are checking ModelOperation before passing ownerField in our subscription request.
Correct me if wrong but i don't think a user needs CREATE, UPDATE, DELETE, perms to be able to receive ON_CREATE, ON_UPDATE, ON_DELETE subscriptions. I don't have to give a user UPDATE permission to my api for them to be notified of an update made to a record they observe.
amplify cli still build the subscriptions with the owner field... (will send examples shortly)
take this model definition as an example:
this is what cli outputs
Trying to sub from the android app will fail as owner field will not be passed in given the conditions set in the method in question.
I would think that all we need to check in this case is ModelOperations.READ
The text was updated successfully, but these errors were encountered: