question

Ion avatar image
Ion asked

Implementing auto-accept Guild/Clan - Policy problem

Hello!

I am trying to update from the dashboard the policy of a group/clan/guild created in the dashboard for testing, for allowing auto-accept a group application.

But i am having an error, but i have seen examples and i can't see what is wrong.

[
    {
        "Statements": [
            {
                "Resource": "pfrn:api--/Entity/AcceptGroupApplication",
                "Action": "*",
                "Effect": "Allow",
                "Principal": "*",
                "Comment": "Allow people to auto-accept applications"
            }
        ],
        "Entity": {
            "Id": "5EA61078C38668EB",
            "Type": "title_player_account",
            "TypeString": "title_player_account"
        }
    }
]

This is the error:

Error
Invalid Effect Type Allow

Is this the only way to allowing auto accept applications in groups?

What am i doing wrong?

I don't know if the Entity is correct or the "configuration" is ok, but i can't try it.

It should be great a policy example for clans like this.

Thanks!

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.

Ion avatar image Ion commented ·

I tried by code, but seems like something is wrong with the parameters.

 SetEntityProfilePolicyRequest request = new SetEntityProfilePolicyRequest();
        request.Entity = result.Group;
        request.Statements = new List<EntityPermissionStatement>();
        EntityPermissionStatement newStatement = new EntityPermissionStatement()
        {
            Action = "Read",
            Comment = "Allow auto accept",
            Effect = EffectType.Allow,
            Principal = "*",
            Resource = "pfrn:api--/Entity/AcceptGroupApplication",
        };
        request.Statements.Add(newStatement);
        PlayFabEntityAPI.SetProfilePolicy(request, OnUpdateGroupPolicy, OnErrorShared);

And the error:

/Profile/SetProfilePolicy: Invalid action Read in statement.

I tried using "*" and "Write" in "Action" parameter and i get the same error.

Thanks for the support.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

First, I would recommend using the API call, unless you want to be explicit about re-entering all the group policies whenever you edit, as the editor in the Game Manager is not additive - you're setting the complete group policy whenever you edit using it.

Now, if what you're trying to do is allow auto-join of the group, this is the permission you should be using:

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

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

Ion avatar image Ion commented ·

Thanks Brendan,

My idea is that all the clans allows auto acept. I implemented that by cloud script, it works perfectly.

That policy would work for this scenario then?

Maybe when a user creates the clan, could set the clan as private or public, and set a level limit for appliyng. But this i could control through client (before trying to join), or in the same function of auto-accept, checking the data of the group or something similar.

What would you recommend? Using policies or API calls? For auto-joining i mean.

Thanks!

0 Likes 0 ·
brendan avatar image brendan Ion commented ·

It depends upon what your goals are. I tend to prefer using API calls, as a global auto-allow-join takes too much control away from you as the title owner. If you always allowed people to join, what would be your plan for managing griefers who join groups just to mess with people?

0 Likes 0 ·
Ion avatar image Ion brendan commented ·

The idea is to put some limitation to the groups, like the minimum level to join.

Also, the users could report the clan member and with X reports could be removed from the clan or something like that. I'm not acquainted with this...

Thanks.

0 Likes 0 ·
Show more comments

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.