()
| 194 | } |
| 195 | |
| 196 | func (c Chat) RBACObject() rbac.Object { |
| 197 | obj := rbac.ResourceChat. |
| 198 | WithID(c.ID). |
| 199 | WithOwner(c.OwnerID.String()). |
| 200 | InOrg(c.OrganizationID) |
| 201 | |
| 202 | if rbac.ChatACLDisabled() { |
| 203 | return obj |
| 204 | } |
| 205 | |
| 206 | return obj. |
| 207 | WithACLUserList(c.UserACL.RBACACL()). |
| 208 | WithGroupACL(c.GroupACL.RBACACL()) |
| 209 | } |
| 210 | |
| 211 | func (c Chat) IsSubChat() bool { |
| 212 | return c.RootChatID.Valid || c.ParentChatID.Valid |