@cocreate/socket-server 1.7.6 → 1.7.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/package.json +1 -1
- package/src/index.js +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
## [1.7.7](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.7.6...v1.7.7) (2023-05-11)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
6
|
+
* Acesss Denied handeling of createOrg ([ca9152c](https://github.com/CoCreate-app/CoCreate-socket-server/commit/ca9152c3792e084fb12f5942772c40c757f30370))
|
|
7
|
+
|
|
1
8
|
## [1.7.6](https://github.com/CoCreate-app/CoCreate-socket-server/compare/v1.7.5...v1.7.6) (2023-05-10)
|
|
2
9
|
|
|
3
10
|
|
package/package.json
CHANGED
package/src/index.js
CHANGED
|
@@ -146,16 +146,18 @@ class SocketServer extends EventEmitter{
|
|
|
146
146
|
if (this.authInstance)
|
|
147
147
|
user_id = await this.authInstance.getUserId(req);
|
|
148
148
|
|
|
149
|
-
if (
|
|
150
|
-
// if (this.permissionInstance) {
|
|
149
|
+
if (this.permissionInstance) {
|
|
151
150
|
const permission = await this.permissionInstance.check(action, data, req, user_id)
|
|
152
151
|
if (!permission || permission.error) {
|
|
153
152
|
// if (action == 'syncServer' && permission.database === true)
|
|
154
153
|
// if (action == 'syncServer')
|
|
155
154
|
// this.emit('createDocument', socket, data);
|
|
156
155
|
// else
|
|
157
|
-
|
|
158
|
-
|
|
156
|
+
if (action !== 'createOrg')
|
|
157
|
+
return this.send(socket, 'Access Denied', {action, permission, ...data})
|
|
158
|
+
else
|
|
159
|
+
this.send(socket, 'Access Denied', {action, permission})
|
|
160
|
+
|
|
159
161
|
}
|
|
160
162
|
}
|
|
161
163
|
|