question

nicolasballester avatar image
nicolasballester asked

How to delete a group from client

Each player can create his own group, which is nice, i store the groupId on the player so i can access it whenever i want. I want him to be able to delete it too, but i got 401 error.

How can i achieve that? And most important, when i activate that policy, everyone will be able to delete groups no matter if they are on it?

LogPlayFab: Response : {"code":401,"status":"Unauthorized","error":"NotAuthorized","errorCode":1089,"errorMessage":"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 i
n PlayFab's Admin Api to add a permission."}
apis
10 |1200

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

1 Answer

·
Citrus Yan avatar image
Citrus Yan answered

The following policy statement enables the members of the group administrator to delete the group they’re in:

  {
    "Action": "*",
    "Effect": "Allow",
    "Resource": "pfrn:group--*!*",
    "Principal": {
      "MemberOf": {
        "RoleId": "admins"
      }
    },
    "Comment": "Allow members of the group administrator role to modify the group metadata",
    "Condition": null
  },


And, this statement should be included in the default policy for all newly created groups, and a player who creates a group is automatically assigned as the role of administrator, therefore in your case players should be able to delete the groups they created by default. Did you erase the default policy after group creation?

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.

nicolasballester avatar image nicolasballester commented ·

No, i didn't, the project its old so maybe when it was created the default policy was another. BTW, thanks for the tip Citrus.

0 Likes 0 ·
Citrus Yan avatar image Citrus Yan nicolasballester commented ·

No problem, are you able to getting things working properly now?

0 Likes 0 ·
nicolasballester avatar image nicolasballester Citrus Yan commented ·

Yeah! now everything works smooth, i was testing it ^^

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.