@live-change/email-service 0.9.187 → 0.9.189

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.
Files changed (3) hide show
  1. package/auth.js +5 -1
  2. package/config.js +8 -1
  3. package/package.json +3 -3
package/auth.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import definition from './definition.js'
2
2
 
3
+ import config from './config.js'
4
+
3
5
  const User = definition.foreignModel('user', 'User')
4
6
 
5
7
  const preFilter = email => email.toLowerCase()
@@ -14,7 +16,9 @@ const Email = definition.model({
14
16
  }
15
17
  },
16
18
  userItem: {
17
- userReadAccess: () => true
19
+ userReadAccess: () => true,
20
+ readAccess: config.userEmailsReaderRoles,
21
+ writeAccess: config.userEmailsWriterRoles,
18
22
  }
19
23
  })
20
24
 
package/config.js CHANGED
@@ -44,6 +44,11 @@ const renderMethod = getValue(definition.config.renderMethod, process.env.EMAIL_
44
44
 
45
45
  definition.clientConfig = {}
46
46
 
47
+ const {
48
+ userEmailsReaderRoles = ['admin', 'owner'],
49
+ userEmailsWriterRoles = ['admin'],
50
+ } = definition.config
51
+
47
52
  const config = {
48
53
  browser,
49
54
  smtp,
@@ -52,7 +57,9 @@ const config = {
52
57
  definition.config.browser?.ssrUrl,
53
58
  process.env.SSR_URL,
54
59
  'http://localhost:8001'
55
- )
60
+ ),
61
+ userEmailsReaderRoles,
62
+ userEmailsWriterRoles,
56
63
  }
57
64
 
58
65
  export default config
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@live-change/email-service",
3
- "version": "0.9.187",
3
+ "version": "0.9.189",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -21,7 +21,7 @@
21
21
  "url": "https://www.viamage.com/"
22
22
  },
23
23
  "dependencies": {
24
- "@live-change/framework": "^0.9.187",
24
+ "@live-change/framework": "^0.9.189",
25
25
  "got": "^11.8.6",
26
26
  "html-to-text": "8.1.0",
27
27
  "inline-css": "4.0.2",
@@ -32,6 +32,6 @@
32
32
  "postcss-calc": "10.1.1",
33
33
  "postcss-custom-properties": "14.0.4"
34
34
  },
35
- "gitHead": "9cb9fc01eebdafb342a419cde03eafdf467eaa32",
35
+ "gitHead": "0b67df26a5b3bc97beab18cbfda516b62f80bcd8",
36
36
  "type": "module"
37
37
  }