question

Kytan avatar image
Kytan asked

Unable to find Group using "List Membership" if not a member.

I'm using "List Membership" to find out in which groups an entity is in, that works fine only if the client is currently in the same group as that entity, can I make it so anyone can see in which group an entity is currently in? Thanks in advance.

apisentitiesunreal
10 |1200

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

Gosen Gao avatar image
Gosen Gao answered

Usually you can call ListMembership API to get the groups you are in because there is an access policy. If you want to permit of anyone accessing any groups, you can change the access policy by SetGlobalPolicy. The policy is as follows:

{
    "Action": "Read",
    "Effect": "Allow",
    "Resource": "pfrn:group--*!*/Roles/*",
    "Principal": {
      "ChildOf": {
        "EntityType": "title",
        "EntityId": "[Your title ID]"
      }
    },
    "Comment": "Allow all entities of the title to read all roles in the group",
    "Condition": null
}

Another way is to call ListMembership API using cloudscript where the level is title, and it can get all groups in game. Please choose according to your needs.

10 |1200

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

Mohsen Jamali avatar image
Mohsen Jamali answered

I also found out that you can set the global policy in [title settings] -> [API Features] and that will override the local policy of all groups

10 |1200

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

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.