mirror of
https://github.com/coder/coder.git
synced 2026-06-03 04:58:23 +00:00
feat: add chat sharing foundation (#25041)
This commit is contained in:
@@ -194,7 +194,22 @@ func (t Task) RBACObject() rbac.Object {
|
||||
}
|
||||
|
||||
func (c Chat) RBACObject() rbac.Object {
|
||||
return rbac.ResourceChat.WithID(c.ID).WithOwner(c.OwnerID.String()).InOrg(c.OrganizationID)
|
||||
obj := rbac.ResourceChat.
|
||||
WithID(c.ID).
|
||||
WithOwner(c.OwnerID.String()).
|
||||
InOrg(c.OrganizationID)
|
||||
|
||||
if rbac.ChatACLDisabled() {
|
||||
return obj
|
||||
}
|
||||
|
||||
return obj.
|
||||
WithACLUserList(c.UserACL.RBACACL()).
|
||||
WithGroupACL(c.GroupACL.RBACACL())
|
||||
}
|
||||
|
||||
func (c Chat) IsSubChat() bool {
|
||||
return c.RootChatID.Valid || c.ParentChatID.Valid
|
||||
}
|
||||
|
||||
func (r GetChatsRow) RBACObject() rbac.Object {
|
||||
|
||||
Reference in New Issue
Block a user