question

bananalopa avatar image
bananalopa asked

Way to join entity group

Hello!

I need to allow players to join entity group, but can't find a way to do it.

At first I tried example from the blog https://api.playfab.com/blog/permission-policies to allow everything.

{
    "Resource":"pfrn:api--*",
    "Principal":"*",
    "Effect":"Allow",
    "Action":"*",
    "Comment":"This will allow anyone to call anything"
}

No success, even cannot be saved into json on the server.

Error:

Failed to save new global policy: Invalid action * in statement.

Then I found this thread: https://community.playfab.com/questions/18393/implementing-auto-accept-guildclan-policy-problem.html

and tried to use

{
"Resource":"pfrn:group--group!*/Applications/*",
"Action":"Accept",
"Effect":"Allow",
"Principal":{"MemberOf":{"GroupId":"[THISENTITY]","RoleId":"*"}},
"Comment":"Allow people to auto-accept applications"
}

It saved correctly in permission json on the server, but gave no effect.

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

Maybe I missed some useful resources where I can see actual syntax of possible "Resource" and "Principal" parameters? All the other more or less clear but these two parameters work as a magic, I have no idea how to edit them to get what I need

 
              
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.

bananalopa avatar image bananalopa commented ·

Looks like to allow everything need to use json like this:

  {
    "Action": "*",
    "Effect": "Allow",
    "Resource": "*--*",
    "Principal": "*",
    "Comment": "Allow everything",
    "Condition": null
  }

But obviously it is't good solution from security side.

How it could be changed to allow only group joining for the certain user?

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

“allow players to join entity group”: a player can apply to join the group without setting any policy. If you are considering a policy like auto-approval, the quick solution is that adding a player to a group directly without any application via AddMembers.

As Brendan said in your reference post, API calls are recommended meanwhile we suggest you not using API policy or Entity Policy at the moment since there is no detailed documentation explaining the use of it. The Policy is currently under development and some features may added and replaced. Your continuous attention to this feature will be appreciated and if possible you can send a post in Feature Request forum section.

For complicated group rules setup, we highly recommend you to write Cloud Scripts which can fulfill most of the needs.

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.

bananalopa avatar image bananalopa commented ·

Thank you for the clue, I'll try to use AddMembers call

1 Like 1 ·
Chris Moore avatar image
Chris Moore answered

Any updates here? Is using Entity Groups for Clans a dead idea? Lots of features mentioned 1.5 years ago still don't seem to be there.

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.