如何解决有没有办法在嵌套突变中使用@can?
我正在与流明上的Lighthouse-Php一起使用,我很好地使用策略来检查用户对某些模型和所有事物的访问权限,但仅在主层级别上。有一种使用嵌套突变策略的方法吗?想象一下这样的嵌套模式。
UpdateMyOrder(input: UpdateOrderInput! @spread) : Order @update @can(ability:"update") #here @can works fine
input UpdateOrderInput{
id: ID!
estimates: EstimatesOperations @nest
}
input EstimatesOperations {
update: UpdateEstimateInput @update(relation: "estimates")
}
input UpdateEstimateInput {
id: ID!
revisions: RevisionOperations @nest
}
input RevisionOperations {
update: UpdateRevisionInput
@can(ability: "update") # this can should work with RevisionPolicy,but it is not even called.
@update(relation: "revisions")
}
input UpdateRevisionInput {
id: ID!
revision_status: String!
}
简而言之,订单具有估算,而估算具有修订。我可以在订单中使用 @can ,但不能在修订版中使用。有没有一种方法可以定义通过嵌套突变对突变修订版本的访问?
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。