Skip to content
This repository was archived by the owner on Jun 28, 2025. It is now read-only.

Commit 3c78aab

Browse files
authored
Merge pull request #16 from vim/add-settings-sync-plugin
Add config-sync plugin
2 parents a29c918 + 50aa79d commit 3c78aab

File tree

42 files changed

+5225
-47
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+5225
-47
lines changed

cms/.editorconfig

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ root = true
22

33
[*]
44
indent_style = space
5-
indent_size = 2
5+
indent_size = 4
66
end_of_line = lf
77
charset = utf-8
88
trim_trailing_whitespace = true
99
insert_final_newline = true
1010

1111
[{package.json,*.yml}]
1212
indent_style = space
13-
indent_size = 2
13+
indent_size = 4
1414

1515
[*.md]
1616
trim_trailing_whitespace = false

cms/config/admin.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,7 @@ export default ({ env }) => ({
1313
flags: {
1414
nps: env.bool('FLAG_NPS', true),
1515
},
16+
watchIgnoreFiles: [
17+
'**/config/sync/**',
18+
],
1619
});

cms/config/plugins.ts

Lines changed: 32 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,37 @@
11
// ./config/plugins.js`
2-
'use strict';
2+
"use strict";
33

4-
module.exports = {
5-
menus: {
6-
config: {
7-
layouts: {
8-
menuItem: {
9-
link: [
10-
{
11-
input: {
12-
label: 'Page Relation',
13-
name: 'page_relation',
14-
type: 'relation',
15-
},
16-
grid: {
17-
col: 6,
18-
},
4+
module.exports = ({ env }) => ({
5+
menus: {
6+
config: {
7+
layouts: {
8+
menuItem: {
9+
link: [
10+
{
11+
input: {
12+
label: "Page Relation",
13+
name: "page_relation",
14+
type: "relation",
15+
},
16+
grid: {
17+
col: 6,
18+
},
19+
},
20+
],
21+
},
1922
},
20-
],
2123
},
22-
},
2324
},
24-
},
25-
};
25+
"config-sync": {
26+
enabled: true,
27+
config: {
28+
syncDir: "config/sync/",
29+
minify: false,
30+
soft: false,
31+
importOnBootstrap: env("NODE_ENV") !== "development",
32+
customTypes: [],
33+
excludedTypes: [],
34+
excludedConfig: [],
35+
},
36+
},
37+
});
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
{
2+
"name": "Author",
3+
"code": "strapi-author",
4+
"description": "Authors can manage the content they have created.",
5+
"permissions": [
6+
{
7+
"action": "plugin::content-manager.explorer.create",
8+
"actionParameters": {},
9+
"subject": "api::newspost.newspost",
10+
"properties": {
11+
"fields": [
12+
"title",
13+
"text"
14+
]
15+
},
16+
"conditions": [
17+
"admin::is-creator"
18+
]
19+
},
20+
{
21+
"action": "plugin::content-manager.explorer.delete",
22+
"actionParameters": {},
23+
"subject": "api::newspost.newspost",
24+
"properties": {},
25+
"conditions": [
26+
"admin::is-creator"
27+
]
28+
},
29+
{
30+
"action": "plugin::content-manager.explorer.read",
31+
"actionParameters": {},
32+
"subject": "api::newspost.newspost",
33+
"properties": {
34+
"fields": [
35+
"title",
36+
"text"
37+
]
38+
},
39+
"conditions": [
40+
"admin::is-creator"
41+
]
42+
},
43+
{
44+
"action": "plugin::content-manager.explorer.update",
45+
"actionParameters": {},
46+
"subject": "api::newspost.newspost",
47+
"properties": {
48+
"fields": [
49+
"title",
50+
"text"
51+
]
52+
},
53+
"conditions": [
54+
"admin::is-creator"
55+
]
56+
},
57+
{
58+
"action": "plugin::content-manager.explorer.create",
59+
"actionParameters": {},
60+
"subject": "api::page.page",
61+
"properties": {
62+
"fields": [
63+
"pageTitle",
64+
"heroSection",
65+
"contentSection"
66+
]
67+
},
68+
"conditions": [
69+
"admin::is-creator"
70+
]
71+
},
72+
{
73+
"action": "plugin::content-manager.explorer.read",
74+
"actionParameters": {},
75+
"subject": "api::page.page",
76+
"properties": {
77+
"fields": [
78+
"pageTitle",
79+
"heroSection",
80+
"contentSection"
81+
]
82+
},
83+
"conditions": [
84+
"admin::is-creator"
85+
]
86+
},
87+
{
88+
"action": "plugin::content-manager.explorer.update",
89+
"actionParameters": {},
90+
"subject": "api::page.page",
91+
"properties": {
92+
"fields": [
93+
"pageTitle",
94+
"heroSection",
95+
"contentSection"
96+
]
97+
},
98+
"conditions": [
99+
"admin::is-creator"
100+
]
101+
},
102+
{
103+
"action": "plugin::upload.assets.copy-link",
104+
"actionParameters": {},
105+
"subject": null,
106+
"properties": {},
107+
"conditions": []
108+
},
109+
{
110+
"action": "plugin::upload.assets.create",
111+
"actionParameters": {},
112+
"subject": null,
113+
"properties": {},
114+
"conditions": []
115+
},
116+
{
117+
"action": "plugin::upload.assets.download",
118+
"actionParameters": {},
119+
"subject": null,
120+
"properties": {},
121+
"conditions": []
122+
},
123+
{
124+
"action": "plugin::upload.assets.update",
125+
"actionParameters": {},
126+
"subject": null,
127+
"properties": {},
128+
"conditions": [
129+
"admin::is-creator"
130+
]
131+
},
132+
{
133+
"action": "plugin::upload.configure-view",
134+
"actionParameters": {},
135+
"subject": null,
136+
"properties": {},
137+
"conditions": []
138+
},
139+
{
140+
"action": "plugin::upload.read",
141+
"actionParameters": {},
142+
"subject": null,
143+
"properties": {},
144+
"conditions": [
145+
"admin::is-creator"
146+
]
147+
}
148+
]
149+
}
Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
{
2+
"name": "Editor",
3+
"code": "strapi-editor",
4+
"description": "Editors can manage and publish contents including those of other users.",
5+
"permissions": [
6+
{
7+
"action": "plugin::content-manager.explorer.create",
8+
"actionParameters": {},
9+
"subject": "api::newspost.newspost",
10+
"properties": {
11+
"fields": [
12+
"title",
13+
"text"
14+
]
15+
},
16+
"conditions": []
17+
},
18+
{
19+
"action": "plugin::content-manager.explorer.delete",
20+
"actionParameters": {},
21+
"subject": "api::newspost.newspost",
22+
"properties": {},
23+
"conditions": []
24+
},
25+
{
26+
"action": "plugin::content-manager.explorer.publish",
27+
"actionParameters": {},
28+
"subject": "api::newspost.newspost",
29+
"properties": {},
30+
"conditions": []
31+
},
32+
{
33+
"action": "plugin::content-manager.explorer.read",
34+
"actionParameters": {},
35+
"subject": "api::newspost.newspost",
36+
"properties": {
37+
"fields": [
38+
"title",
39+
"text"
40+
]
41+
},
42+
"conditions": []
43+
},
44+
{
45+
"action": "plugin::content-manager.explorer.update",
46+
"actionParameters": {},
47+
"subject": "api::newspost.newspost",
48+
"properties": {
49+
"fields": [
50+
"title",
51+
"text"
52+
]
53+
},
54+
"conditions": []
55+
},
56+
{
57+
"action": "plugin::content-manager.explorer.create",
58+
"actionParameters": {},
59+
"subject": "api::page.page",
60+
"properties": {
61+
"fields": [
62+
"pageTitle",
63+
"heroSection",
64+
"contentSection"
65+
]
66+
},
67+
"conditions": []
68+
},
69+
{
70+
"action": "plugin::content-manager.explorer.read",
71+
"actionParameters": {},
72+
"subject": "api::page.page",
73+
"properties": {
74+
"fields": [
75+
"pageTitle",
76+
"heroSection",
77+
"contentSection"
78+
]
79+
},
80+
"conditions": []
81+
},
82+
{
83+
"action": "plugin::content-manager.explorer.update",
84+
"actionParameters": {},
85+
"subject": "api::page.page",
86+
"properties": {
87+
"fields": [
88+
"pageTitle",
89+
"heroSection",
90+
"contentSection"
91+
]
92+
},
93+
"conditions": []
94+
},
95+
{
96+
"action": "plugin::upload.assets.copy-link",
97+
"actionParameters": {},
98+
"subject": null,
99+
"properties": {},
100+
"conditions": []
101+
},
102+
{
103+
"action": "plugin::upload.assets.create",
104+
"actionParameters": {},
105+
"subject": null,
106+
"properties": {},
107+
"conditions": []
108+
},
109+
{
110+
"action": "plugin::upload.assets.download",
111+
"actionParameters": {},
112+
"subject": null,
113+
"properties": {},
114+
"conditions": []
115+
},
116+
{
117+
"action": "plugin::upload.assets.update",
118+
"actionParameters": {},
119+
"subject": null,
120+
"properties": {},
121+
"conditions": []
122+
},
123+
{
124+
"action": "plugin::upload.configure-view",
125+
"actionParameters": {},
126+
"subject": null,
127+
"properties": {},
128+
"conditions": []
129+
},
130+
{
131+
"action": "plugin::upload.read",
132+
"actionParameters": {},
133+
"subject": null,
134+
"properties": {},
135+
"conditions": []
136+
}
137+
]
138+
}

0 commit comments

Comments
 (0)