@steedos/ee_branding 2.5.0-beta.8 → 2.5.0
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.
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
name: admin_license
|
|
2
|
+
desktop: true
|
|
3
|
+
icon: webcart
|
|
4
|
+
is_new_window: false
|
|
5
|
+
label: 许可证
|
|
6
|
+
mobile: true
|
|
7
|
+
permissions:
|
|
8
|
+
- permission: 'on'
|
|
9
|
+
permission_set: admin
|
|
10
|
+
- permission: 'off'
|
|
11
|
+
permission_set: user
|
|
12
|
+
- permission: 'off'
|
|
13
|
+
permission_set: customer
|
|
14
|
+
- permission: 'off'
|
|
15
|
+
permission_set: supplier
|
|
16
|
+
- permission: 'off'
|
|
17
|
+
permission_set: organization_admin
|
|
18
|
+
- permission: 'off'
|
|
19
|
+
permission_set: workflow_admin
|
|
20
|
+
type: url
|
|
21
|
+
url: /app/admin/license/grid/all
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
name: spaces_branding_check
|
|
2
|
+
listenTo: spaces
|
|
3
|
+
when:
|
|
4
|
+
- beforeInsert
|
|
5
|
+
- beforeUpdate
|
|
6
|
+
isEnabled: true
|
|
7
|
+
handler: >-
|
|
8
|
+
const LOGO_FIELDS = ['account_logo', 'avatar_dark', 'avatar_square', 'avatar',
|
|
9
|
+
'background', 'favicon'];
|
|
10
|
+
|
|
11
|
+
const { doc, spaceId } = ctx.params;
|
|
12
|
+
|
|
13
|
+
let needToCheck = false
|
|
14
|
+
|
|
15
|
+
for (const fieldName of LOGO_FIELDS) {
|
|
16
|
+
if (doc[fieldName]) {
|
|
17
|
+
needToCheck = true
|
|
18
|
+
break
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
if (needToCheck) {
|
|
23
|
+
const allow = await ctx.broker.call(`@steedos/service-package-license.isPlatformEnterPrise`, { spaceId });
|
|
24
|
+
if (!allow) {
|
|
25
|
+
throw new Error('need_platform_enterprise');
|
|
26
|
+
}
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@steedos/ee_branding",
|
|
3
|
-
"version": "2.5.0
|
|
3
|
+
"version": "2.5.0",
|
|
4
4
|
"main": "package.service.js",
|
|
5
5
|
"scripts": {},
|
|
6
6
|
"license": "MIT",
|
|
@@ -8,8 +8,5 @@
|
|
|
8
8
|
"publishConfig": {
|
|
9
9
|
"access": "public"
|
|
10
10
|
},
|
|
11
|
-
"
|
|
12
|
-
"@steedos/license": "2.2.8"
|
|
13
|
-
},
|
|
14
|
-
"gitHead": "537101194e8c7c61a4eed846d28382126d947775"
|
|
11
|
+
"gitHead": "4428143293b96ef93b2bbeef0cd6691c9baa8e4f"
|
|
15
12
|
}
|
package/LICENSE.txt
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
Steedos Licensing
|
|
2
|
-
|
|
3
|
-
SOFTWARE LICENSING
|
|
4
|
-
|
|
5
|
-
To determine under which license you may use a file from the Steedos source code,
|
|
6
|
-
please resort to the header of that file.
|
|
7
|
-
|
|
8
|
-
If the file has no header, the following rules apply
|
|
9
|
-
1. enterprise features are licensed under Steedos Enterprise Terms, see License.enterprise.txt
|
|
10
|
-
2. source code that is neither (1) is licensed under MIT, see https://opensource.org/licenses/MIT
|
|
11
|
-
|
|
12
|
-
On request, licenses under different terms are available.
|
|
13
|
-
|
|
14
|
-
Source code of enterprise features are files that
|
|
15
|
-
* are in folders named "ee" or start with "ee_", or in subfolders of such folders.
|
|
16
|
-
* contain the strings "ee_" in its filename name.
|
|
17
|
-
The files can be found by running the command `find . -iname ee -or -iname "*_ee*" -or -iname "*ee_*"`
|
|
18
|
-
|
|
19
|
-
STEEDOS TRADEMARK GUIDELINES
|
|
20
|
-
|
|
21
|
-
Your use of the mark Steedos is subject to Steedos, Inc's prior written approval. For trademark approval or any questions
|
|
22
|
-
you have about using these trademarks, please email zhuangjianguo@steedos.com
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: sunhaolin@hotoa.com
|
|
3
|
-
* @Date: 2022-07-01 14:07:26
|
|
4
|
-
* @LastEditors: sunhaolin@hotoa.com
|
|
5
|
-
* @LastEditTime: 2022-07-01 14:57:56
|
|
6
|
-
* @Description:
|
|
7
|
-
*/
|
|
8
|
-
'use strict'
|
|
9
|
-
|
|
10
|
-
const { isPlatformEnterPrise } = require('@steedos/license')
|
|
11
|
-
const LOGO_FIELDS = ['account_logo', 'avatar_dark', 'avatar_square', 'avatar', 'background', 'favicon']
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* 只有企业版才能更改Logo
|
|
15
|
-
* @param {*} triggerContext
|
|
16
|
-
*/
|
|
17
|
-
async function checkIsEnterprise(triggerContext) {
|
|
18
|
-
const { doc, spaceId } = triggerContext;
|
|
19
|
-
if (spaceId) {
|
|
20
|
-
let needToCheck = false
|
|
21
|
-
for (const fieldName of LOGO_FIELDS) {
|
|
22
|
-
if (doc[fieldName]) {
|
|
23
|
-
needToCheck = true
|
|
24
|
-
break
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
if (needToCheck) {
|
|
28
|
-
const allow = await isPlatformEnterPrise(spaceId)
|
|
29
|
-
if (!allow) {
|
|
30
|
-
throw new Error('need_platform_enterprise');
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
module.exports = {
|
|
37
|
-
checkIsEnterprise
|
|
38
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* @Author: sunhaolin@hotoa.com
|
|
3
|
-
* @Date: 2022-07-01 14:05:45
|
|
4
|
-
* @LastEditors: sunhaolin@hotoa.com
|
|
5
|
-
* @LastEditTime: 2022-07-01 14:40:48
|
|
6
|
-
* @Description:
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
|
-
const {
|
|
10
|
-
checkIsEnterprise
|
|
11
|
-
} = require('../manager/spaces')
|
|
12
|
-
|
|
13
|
-
module.exports = {
|
|
14
|
-
listenTo: "spaces",
|
|
15
|
-
|
|
16
|
-
beforeInsert: async function () {
|
|
17
|
-
await checkIsEnterprise(this)
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
beforeUpdate: async function () {
|
|
21
|
-
await checkIsEnterprise(this)
|
|
22
|
-
}
|
|
23
|
-
}
|