```coffeescript
Meteor.startup ->
	RocketChat.settings.add 'Message_AllowPinning', true, { type: 'boolean', group: 'Message', public: true }

	RocketChat.models.Permissions.upsert('pin-message', {$addToSet: {roles: {$each: ['owner', 'moderator', 'admin']}}})
```

Set pin-message permissions only on insert
user
```coffeescript
Meteor.startup ->
	RocketChat.settings.add 'Message_AllowPinning', true, { type: 'boolean', group: 'Message', public: true }
	RocketChat.models.Permissions.upsert('pin-message', { $setOnInsert: { roles: ['owner', 'moderator', 'admin'] } });
```
assistant