question

spsjagadeesh avatar image
spsjagadeesh asked

InviteToGroup(Entity Group API) error

When I try to send invite to player entity from client , it throws the error "The claim was not allowed to perform the requested action based on the entity's access policy. Policy comment: By default, all requests are denied. If you expected this request to succeed, you may be missing a policy. See the permissions APIs in PlayFab's Admin Api to add a permission."

I couldn't find any proper documentation on how to update Policy.

Do I need to update the Entity Global Policy or add new policy for each group?

I was able to create a group, but couldn't send invite to any other entity

apisentities
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

JayZuo avatar image
JayZuo answered

How did you create this group? By default, there are two roles in a group: "admins" and "members". And only "admins" can invite people. If the player is a "members" and try to "InviteToGroup", you will get the error above. There is no detailed documentation about Group Policy at this moment as it is currently under development and some features may be modified. If your group is created from client, then the player who created this group can invite others.

To update group policy, you can either use Entity Global Policy or edit each group's policy when creating. It depends on your requirement. If all the groups have same policy, you can then try with Entity Global Policy.

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

spsjagadeesh avatar image spsjagadeesh commented ·

Thanks @Jay Zuo. I was trying to send invite via entity which has "member" role

0 Likes 0 ·
Mohsen Jamali avatar image
Mohsen Jamali answered

Is there any update on this question. What is the resource API to use for InviteToGroup? I used this pfrn:group--!/InviteToGroup/* and it seems to be incorrect

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Mohsen Jamali avatar image
Mohsen Jamali answered

Why the group policy is not documented?

I figured out the answer this policy will allow all the members to invite players

{ "Action": "", "Effect": "Allow", "Resource": "pfrn:group--!/Invitations/", "Principal": { "MemberOf": { "RoleId": "*" } }, "Comment": "Allow all members to invite players", "Condition": null }

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.