Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by James McGhee · Oct 23, 2020 at 01:03 PM · entities

ENTITY GLOBAL TITLE POLICY so that only members can read Entity Objects of an Entity Group

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.

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

1 Reply

· Add your reply
  • Sort: 
avatar image
Best Answer

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:

  • Use CreateGroup API to create a group. The creator account will become a group admin by default.
  • Use GetProfile API to get the group profile. By default, there should be a policy looks like this (I used Postman):
                {
                    "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"
                }
  • This is the policy that controls who can Read and Write the Entity Object using GetObjects and SetObjects.
  • Copy the entire Policy Statements, change the “RoleId” property from “admins” to “*”, then paste to the SetProfilePolicy API request body and send the request to update the policy.
  • After update successfully, the group will allow any members to read and write to the group’s Entity Object.
    If you have any further questions, please feel free to ask.

Comment

People who like this

0 Show 2 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image James McGhee · Oct 27, 2020 at 03:05 AM 0
Share

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.

avatar image Junjin Chen James McGhee · Oct 29, 2020 at 08:11 AM 0
Share

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.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    4 People are following this question.

    avatar image avatar image avatar image avatar image

    Related Questions

    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

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges