summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/rest/permissions.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2020-12-06 23:16:02 +0100
committerGitHub <noreply@github.com>2020-12-06 23:16:02 +0100
commit0d7315249d20bf9856605068074a7b6c6bcce835 (patch)
treef8ab7e0f3e96491e439eb49beebf3fae658215c4 /vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/rest/permissions.go
parent4913766d58cd1fe204b27dc93172c5dd4a95a88a (diff)
downloadmatterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.tar.gz
matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.tar.bz2
matterbridge-msglm-0d7315249d20bf9856605068074a7b6c6bcce835.zip
Update vendor (#1330)
Diffstat (limited to 'vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/rest/permissions.go')
-rw-r--r--vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/rest/permissions.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/rest/permissions.go b/vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/rest/permissions.go
new file mode 100644
index 00000000..2ccbd2f1
--- /dev/null
+++ b/vendor/github.com/matterbridge/Rocket.Chat.Go.SDK/rest/permissions.go
@@ -0,0 +1,33 @@
+package rest
+
+import (
+ "bytes"
+ "encoding/json"
+
+ "github.com/matterbridge/Rocket.Chat.Go.SDK/models"
+)
+
+type UpdatePermissionsRequest struct {
+ Permissions []models.Permission `json:"permissions"`
+}
+
+type UpdatePermissionsResponse struct {
+ Status
+ Permissions []models.Permission `json:"permissions"`
+}
+
+// UpdatePermissions updates permissions
+//
+// https://rocket.chat/docs/developer-guides/rest-api/permissions/update/
+func (c *Client) UpdatePermissions(req *UpdatePermissionsRequest) (*UpdatePermissionsResponse, error) {
+ body, err := json.Marshal(req)
+ if err != nil {
+ return nil, err
+ }
+
+ response := new(UpdatePermissionsResponse)
+ if err := c.Post("permissions.update", bytes.NewBuffer(body), response); err != nil {
+ return nil, err
+ }
+ return response, nil
+}