Managing Group Members
A user (KiiUser) can be associated with a group (KiiGroup) by two types of relationship in Kii Cloud: member relationship and owner relationship.
Any logged-in user can create a group in the Kii Cloud application. The user who creates a group will become the owner of the group.
A group can have multiple members who can access buckets in the group scope and the resources that the group members are allowed to access by the resource ACL.
The group owner is also the first member of the group.
An owner and a member are expressed as two-way relationships between a KiiUser and a KiiGroup on Kii Cloud. When any group-related actions are performed, for example, addition or removal of a group member and deletion of a user, Kii Cloud automatically updates those two-way relationships.
As indicated in the figure below, you can get relationships between a user and a group with the methods of the
KiiGroup classes of the Kii Cloud SDK. Each string such as
memberOfgroups() in the figure represents the method to get such a relationship.
See the figure below for relationships created through the following three actions as an example of groups and users:
Alice creates the Sales Div. group. Relationships created from this action are indicated by the red arrows.
Alice adds Bob to the Sales Div. group. Relationships created from this action are indicated by the blue arrows.
Bob creates the Tennis Club group. Relationships created from this action are indicated by the green arrows.