question

mak avatar image
mak asked

Default Roles In Group

Hi

When i create group there is default two role created Admin and Member.

But i have different requirement in my game,

I need default 3 roles when i create group

- Admin

- Leader

- Member

like tree structure

Admin can manage leaders and members

Leader can only manage members

I didn't find anything about this in doc. so can you give me suggestion is this thing possible or not.

If possible so how can i do.

Thanks.

data
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

·
Andy avatar image
Andy answered

To create a third role, you'd use the CreateRole API., then you'd use something like ChangeMemberRole to put players into the role.

As to controlling which players can perform which actions within a group, that's easiest to accomplish through cloud script. You'd implement the various actions in cloud script methods that would check the role of the calling player.

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

mak avatar image mak commented ·

Can you explain more on CloudScript because i tried to use GroupAPI in cloud script and i failed, i can not find GroupAPI docs for cloud script any where.

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

I'm actually working on an updated doc for accessing the entity APIs from cloud script. The basic idea, though, is that, similar to how you use the "server" object to get access to the server API, you use the "entity" object to get access to the various parts of the entity API. For instance a cloud script call to AddMembers would look like:

entity.AddMembers

The other thing to keep in mind is that cloud script executes everything as the title entity.

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

Thanks for fast answer

One another thing can you provide details how to make policy that allow any role members can accept group application.

0 Likes 0 ·
Show more comments
mak avatar image mak commented ·

Really thanks for you replay

I have another requirement like

Right now one user can join multiple group at a time, but i have different requirements like one can can only able to join only one group at a time. Can you give me suggestion on this or if possible through policy, so please suggest me that policy.

Thanks

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

If that's a requirement, I'd strongly recommend implementing your AddToGroup logic in cloud script. That way you can check whether the user is already a member of a group and then reject the request if so. You won't be able to accomplish that restriction through entity policy.

1 Like 1 ·
mak avatar image mak commented ·
Hi

 "Resource": "pfrn:group--*!*/Applications/*",
                    "Action": "Accept",
                    "Effect": "Allow",
                    "Principal": {
                        "MemberOf": {
                            "RoleId": "*"
                        }
                    },
                    "Comment": "Allow all group members to approve applications"

this policy can we define in global entity policy or need to define in every group ?
0 Likes 0 ·
Andy avatar image Andy ♦♦ mak commented ·

You can set it at either level, either global, or per-entity.

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.