Gitter migration: Setup redirects (rollout pt. 3)
[gitter.git] / server / services / live-collection-handlers / live-collection-group-security-descriptors.js
blob0e546dbf8d8a087e61c2692766fc887e553f7c35
1 'use strict';
3 const appEvents = require('gitter-web-appevents');
4 const restSerializer = require('../../serializers/rest-serializer');
6 module.exports = {
7 create: function(/*model*/) {
8 // no-op
9 },
11 update: async function(groupId, securityDescriptorModel) {
12 const url = `/groups/${groupId}/security`;
13 const strategy = restSerializer.SecurityDescriptorStrategy.full();
14 const serializedSecurityDescriptor = await restSerializer.serializeObject(
15 securityDescriptorModel,
16 strategy
18 appEvents.dataChange2(url, 'update', serializedSecurityDescriptor, 'group.sd');
21 patch: function(groupId, patch) {
22 const url = `/groups/${groupId}/security`;
23 const patchMessage = {
24 ...patch
25 //groupId
27 appEvents.dataChange2(url, 'patch', patchMessage, 'group.sd');
30 remove: function(/*model*/) {
31 // no-op
34 removeId: function(/*groupId*/) {
35 // no-op