GraphQL dynamic groupsField not working if type of group is list

0

I am trying to create a project for internal employees to give permission based on groupsField.

I have referred the AWS documentation for dynamic permission, but it's not working in my case.

Here's relevant part of graphql schema

type something
@auth(
  rules: [

             { allow: groups, groups: ["Admin"] }
             { allow: groups, groupsField: "groupRead", operations: [read] }
             { allow: public }



]
)
  @model
  @searchable
{
  id: ID!
  phone: String
  email: String
  groupRead: [String!]

}

If I try to search the result from my front-end side and in AppSync, it's not allowing me search anything and give back empty array of items.

Two errors:

Not authorized to access the list gives back empty result

But if I change to groupRead: String!

Then it works for front-end as well as in AppSync. But In this case, for dynamoDB I can not assign more than one value to groupRead. As an admin I want to give them more than one department read permission.

All static group permissions are working perfectly fine, for instance Admin.

Goal: groupRead should be type of list, so in DynamoDB I can pass multiple value to groupRead.

답변 없음

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠