when i trying to update a existing phone number using Hypi id in Account ,getting a error “Unauthorise”
again facing same error when i trying to update nested fields of Account Table
but i can update username in Account Table easily
when i trying to update a existing phone number using Hypi id in Account ,getting a error “Unauthorise”
again facing same error when i trying to update nested fields of Account Table
but i can update username in Account Table easily
Every unauthorised response requires us to answer these questions:
Permission
which grants permission to perform the operation?Can you check these things and confirm to us?
i have already give permission to the Account ,so that the Account is able to change username in Account Table but getting error if i trying to update nested fields with hypi id, but if i add new phone number ,this work fine …but unable to update existing phone or name field with hypi id
Can you share the values you used when creating the permission for these fields:
scopes, operationType, operations?
From the sounds of things you’ve only created one permission.
Permission for Mutations do not cascade. i.e. if you have an object Account with a field Person, granting access to the Account to be able to update it does not currently also grant access to update the Person linked to the account.
From the sounds of things you’ve only created one permission.
Permission for Mutations do not cascade. i.e. if you have an object Account with a field Person, granting access to the Account to be able to update it does not currently also grant access to update the Person linked to the accoun
mutation permission_id($UserId: ID $resourceId :String) {upsert(values: {Permission: [{name: "Grant access to all user"decisionStrategy: Unanimoustype: "Account"resource: $resourceIdscopes: ["*"]operationType: Queryoperations: ["find"]includeAllAccounts: true}{name: "Grant access to all user"decisionStrategy: Unanimoustype: "Account"resource: $resourceIdscopes: ["*"]operationType: Mutationoperations: ["upsert", "link", "unlink", "delete"]policies:[{hypi: { impl: "AccountPolicy" }name: "Grant access to self"logic: Positiveaccounts: [{ hypi: {id:$UserId} }]}]}]}) {id}}
@Support#127
deepakKashyap it makes it easier to read the code and to help you if you use the code formatter to format the code you share. The editor supports markdown three ` will let you paste multi-line code.
Regarding the code shared, you’ve created a permission for Account
only. You must create one for each type that you want to allow the user to modify. If they can modify PhoneNumber
a permission must be created to allow this as well.
By the way
deepakKashyap name: “Grant access to all user”
This name is mislead - your permission (with operationType: Mutation) does not grant access to all users, only to the user in the account policy.
please provide a working example, for granting permission to Account ,Account.phones , Account.Name
Is this correct?? or please provide a correct example
in your example, change Type
to Phone
and resource
to the ID of the phone object the user should get permission to.
getting this …
Phone
does not have a phones
field. I think you left this in after copying the Account
permission.
The user creating the Permission
must be the owner or was granted permission to modify the Permission
please give me a suitable working example for
permission to phones in Account table
its exactly what you sent to us, just change the type as explained.
mutation permission_id($UserId: ID, $resourceId: String) {
upsert(
values: {
Permission: [
{
name: "Allow all accounts to find phone"
decisionStrategy: Unanimous
type: "Phone"
resource: $resourceId
scopes: ["*"]
operationType: Query
operations: ["find"]
includeAllAccounts: true
}
{
name: "Allow user to modify Phone"
decisionStrategy: Unanimous
type: "Phone"
resource: $resourceId
scopes: ["*"]
operationType: Mutation
operations: ["upsert", "link", "unlink", "delete"]
policies: [
{
hypi: { impl: "AccountPolicy" }
name: "Grant access to self"
logic: Positive
accounts: [{ hypi: { id: $UserId } }]
}
]
}
]
}
) {
id
}
}
Phone permission work fine but facing problem With Owner permission and Owner.Name in Account Table
please update me with correct example…
exactly as the error message says. Unknown type Owner
.
There is no type called owner. If you’re applying this to the built in Account.owner
the type is Person
.
If you’re not sure about the type of a field, use the Hypi UI in the docs tab of the GraphQL editor to look at the type information.