question

software1103 avatar image
software1103 asked

How to update my title's 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.

software1103 avatar image software1103 commented ·

Hello, everyone.

I am a new user to learn playfab.

For now, I am gonna join new player by using InviteToGroup. But I met a issue in work.

The error such like "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." is thrown.

So I explored the resolution through the network and then saw

https://community.playfab.com/questions/23016/entity-api-group-methods-policy-error.html.

But unfortunately, I dont know how to update my title’s policy using the /Admin/UpdatePolicy API call, and retrieve the current policy using /Admin/GetPolicy.

Would you like to explain how to update policy and retrieve the current one in more and more detail?

Because my playfab skill is still young, it is difficult to fine correct answer.

How and where the code being shown below is inserted into?

Thanks...

0 Likes 0 ·
JayZuo avatar image
JayZuo answered

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.

To update Group Policy, you can either use the editor in the Game Manager or SetProfilePolicy API. But before update, could you share more details about your scenario? The policy you've mentioned is not for invitations but for listing members.

10 |1200

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

software1103 avatar image
software1103 answered

Thanks @JayZuo for your reply.

What you mean that /Admin/UpdatePolicy API and /Admin/GetPolicy aren't for invitations but for listing members?

If yes, I want to know how to update Group Policy by using either the editor in the GameManager or SetProfilePolicy API in more detail.

My scenario is that:

1. The first player creates the room.(I'm making simple poker game and I am gonna manage game room(table).) At this stage, his role is "Admin".

2. Next players join the room created by the first player-Admin-by clicking "room" name displayed.

This is simple idea.

At this time, I made group that represents the "game room" generated by player and this is displayed in game manager of playfab.

But there is the issue in the next stage.

If the next player clicks the room name, the id of the group that has the same name with the "room name" is taken now. But based on this group id, I want for the next player to join this group, but above error is thrown.

This is sad thing. I will appreciate your any opinion. thanks @JayZuo

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.

JayZuo avatar image JayZuo ♦ commented ·

According to your description, it seems you want a auto-accept group policy. Then you can refer to https://community.playfab.com/questions/18393/implementing-auto-accept-guildclan-policy-problem.html and https://community.playfab.com/questions/18798/thisentity-and-self-not-working-in-group-policy.html.

But as Brendan said in the first question, using API calls with Could Script might be a better option as you can apply additional logic around group membership. For example, when player clicks the room name, you execute a cloud script function, in this function, you can determine whether the player can join. If he can, you can then use AddMembers in cloud script to add him into the group.

And for the Admin API, it's not used for Group Policy, the error message may cause some confusion. Group is one kind of Entities, you will use GetProfile and SetProfilePolicy.

0 Likes 0 ·

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.