Trying to solve a need where in we need to reasonably assure that only members of a group can read the data in an Entity Object ...
Digging around we found similar questions about restricting who can do what with Entity Group can be configured to some degree via policy.
We also saw in the question here https://community.playfab.com/questions/25747/group-roles.html
That this can be set at the title policy level.
What we cant find is any documentaiton on what the policy should look like. The policy we want to set is simply that any member of a group can read and write to that group's EntityObjects but that non members of the group can neither read nore write to the Entity Objects.
Answer by Junjin Chen · Oct 27, 2020 at 01:47 AM
I am afraid that there is no official document about group policy currently. You could set up the group policy in following steps:
{ "Resource": "pfrn:data--*!*/*", "Action": "*", "Effect": "Allow", "Principal": { "MemberOf": { "RoleId": "admins" } }, "Comment": "Allow members of the group administrator role to modify group profile data and files" }
Would it be possible to make this default possibly via the Entity Global Title Policy or does this need to be done for each group.
No, it cannot be made as default. Nonetheless, you can integrate CreateGroup API and SetProfilePolicy API using CloudScript as below:
handlers.CreateGroupWithPolicy = function(args,context){ player_account = server.GetUserAccountInfo({ PlayFabId: currentPlayerId }); player_entity = player_account.UserInfo.TitleInfo.TitlePlayerAccount; new_group = entity.CreateGroup({GroupName:args.GroupName,Entity:player_entity}); result = entity.SetProfilePolicy({ Statements: your_policy,//paste your entire policy here Entity: new_group.Group }); }
Then the client can use ExecuteCloudScript API to call this function and create a group with the policy statements you defined.
500 error on InitiateFileUploads 1 Answer
Entities, Entity Groups and using them as persistent Data "containers" 1 Answer
Searching Group Entities 2 Answers
Waiting for results in Playfab API 2 Answers
PlayFab create group playmaker action 0 Answers