question

toannguyen avatar image
toannguyen asked

how to setup policy for remove member effectivement?

hi.

I made a group with 3 roles: Admin, Officer and Member.

How to setup policy that guarantee these conditions please:

1. Admin can kick + block only Officer and Member (cant kick and block other Admins)

2. Officer can kick + block only Member

3. Admin and Officer can accept, decline application, block player from apply to their group

4. Admin and Officer can sent invitation to a player to join their group.

5. Admin and Officer can unblock player from Group block list.

Thanks

2 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.

toannguyen avatar image toannguyen commented ·

Ah, 1 condition more please: All role can modify Objects on Guild (using PlayFabDataAPI.SetObjects), thanks very much

0 Likes 0 ·
Andy avatar image Andy ♦♦ toannguyen commented ·

Entity Policy can be a bit tricky, especially since the documentation right now is lacking. The good news is that it's incredibly flexible and can accomplish what you're after. The bad news is that flexibility necessitates complexity right now. I'm going to work through some of your scenarios and let you know how it goes.

0 Likes 0 ·

1 Answer

·
Andy avatar image
Andy answered

Until we have more complete documentation around Entity Policy, I'd advise using Cloud Script to enforce the rules you've described. You'll likely find that to be more straightforward in the absence of a tutorial and comprehensive reference on entity policy.

One note on accessing the group methods from cloud script: You'll want to use the "entity" object to call the various API methods. For instance, a call to BlockEntity would look like:

entity.BlockEntity

Do be a bit careful with regard to blocked players and cloud script actions. The title entity is allowed to bypass the block list when performing group actions. You should always check the block list before adding a member or approving an application from cloud script.

2 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.

toannguyen avatar image toannguyen commented ·

thank you for your answer, but i have more questions:

When i block entity from group, so i can see application from player or not? (when you say "You should always check the block list before adding a member or approving an application from cloud script" but the document doesnt say that)

I just moved to Playfab first time (our team use playfab for control user's data but Guild or Clan function is our target in few week next), so thank you very much for helping me a lot

0 Likes 0 ·
Andy avatar image Andy ♦♦ toannguyen commented ·

Specifically, the title entity can add a member to a group even if that player is on the group's block list. If you're performing all your operations from cloud script, it's the title entity that will be doing the work. My advice is to, in your cloud script that adds members, ensure you check the block list beforehand to avoid adding someone who was meant to be blocked.

And yes, this is not documented. That is a something we're aware of and will be fixing alongside the rest of the entity and policy documentation.

0 Likes 0 ·

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.