@saltcorn/server 0.8.6-beta.1 → 0.8.6-beta.3

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/app.js CHANGED
@@ -231,7 +231,7 @@ const getApp = async (opts = {}) => {
231
231
  { scope: "all" }
232
232
  );
233
233
  else {
234
- return done(null, { role_id: 10 });
234
+ return done(null, { role_id: 100 });
235
235
  }
236
236
  }
237
237
  })
@@ -253,7 +253,7 @@ const getApp = async (opts = {}) => {
253
253
  tenant: db.getTenantSchema(),
254
254
  });
255
255
  } else {
256
- return done(null, { role_id: 10 });
256
+ return done(null, { role_id: 100 });
257
257
  }
258
258
  };
259
259
  if (
@@ -340,7 +340,7 @@ Sitemap: ${base}sitemap.xml
340
340
  const urls = [base];
341
341
  const loop_menu = (items) => {
342
342
  for (const item of items)
343
- if (+item.min_role === 10 || item.subitems) {
343
+ if (+item.min_role === 100 || item.subitems) {
344
344
  if (item.type === "Page")
345
345
  urls.push(`${base}page/${encodeURIComponent(item.pagename)}`);
346
346
  if (item.type === "View")
package/auth/admin.js CHANGED
@@ -86,6 +86,10 @@ const getUserFields = async (req) => {
86
86
  f.validator = (s) => {
87
87
  if (!User.valid_email(s)) return req.__("Not a valid e-mail address");
88
88
  };
89
+ f.attributes = {
90
+ ...(f.attributes || {}),
91
+ input_type: "email",
92
+ };
89
93
  }
90
94
  }
91
95
  return userFields;
package/auth/roleadmin.js CHANGED
@@ -102,6 +102,9 @@ const editRole2FAPolicyForm = (role, twofa_policy_by_role, req) =>
102
102
  const roleForm = (req) =>
103
103
  new Form({
104
104
  action: "/roleadmin/edit",
105
+ validator: (vs) => {
106
+ if (vs.id > 1 && vs.id < 11) return req.__("Role IDs 2-10 are reserved");
107
+ },
105
108
  fields: [
106
109
  {
107
110
  name: "id",
@@ -110,8 +113,8 @@ const roleForm = (req) =>
110
113
  sublabel: req.__(
111
114
  "This is the rank of the user role, lower role IDs will be able to access more resources."
112
115
  ),
113
- default: 7,
114
- attributes: { max: 10, min: 1 },
116
+ default: 70,
117
+ attributes: { max: 100, min: 1 },
115
118
  },
116
119
  { name: "role", label: req.__("Role name"), type: "String" },
117
120
  ],
@@ -156,7 +159,7 @@ router.get(
156
159
  {
157
160
  label: req.__("2FA policy"),
158
161
  key: (role) =>
159
- role.id === 10
162
+ role.id === 100
160
163
  ? ""
161
164
  : editRole2FAPolicyForm(role, twofa_policy_by_role, req),
162
165
  },
@@ -278,7 +281,7 @@ router.post(
278
281
  res.redirect(`/roleadmin`);
279
282
  })
280
283
  );
281
- const unDeletableRoles = [1, 8, 10];
284
+ const unDeletableRoles = [1, 80, 100];
282
285
  /**
283
286
  * @name post/delete/:id
284
287
  * @function
package/auth/routes.js CHANGED
@@ -263,7 +263,7 @@ const loginWithJwt = async (email, password, saltcornApp, res) => {
263
263
  {
264
264
  sub: "public",
265
265
  user: {
266
- role_id: 10,
266
+ role_id: 100,
267
267
  language: "en",
268
268
  },
269
269
  iss: "saltcorn@saltcorn",
package/errors.js CHANGED
@@ -21,7 +21,7 @@ module.exports =
21
21
 
22
22
  const devmode = getState().getConfig("development_mode", false);
23
23
  const log_sql = getState().getConfig("log_sql", false);
24
- const role = (req.user || {}).role_id || 10;
24
+ const role = (req.user || {}).role_id || 100;
25
25
  if (err.message && err.message.includes("invalid csrf token")) {
26
26
  console.error(err.message);
27
27
 
package/locales/en.json CHANGED
@@ -1149,9 +1149,22 @@
1149
1149
  "A page with this name already exists": "A page with this name already exists",
1150
1150
  "Tenant Base URL": "Tenant Base URL",
1151
1151
  "Base hostname for newly created tenants. If unset, defaults to hostname": "Base hostname for newly created tenants. If unset, defaults to hostname",
1152
- "Redirect unathorized": "Redirect unathorized",
1152
+ "Redirect unauthorized": "Redirect unauthorized",
1153
1153
  "If tenant creation is not authorized, redirect to this URL": "If tenant creation is not authorized, redirect to this URL",
1154
1154
  "Import table %s": "Import table %s",
1155
1155
  "Import CSV": "Import CSV",
1156
- "Show configuration object": "Show configuration object"
1157
- }
1156
+ "Show configuration object": "Show configuration object",
1157
+ "Connected views": "Connected views",
1158
+ "Tenant application capabilities": "Tenant application capabilities",
1159
+ "Edit Module": "Edit Module",
1160
+ "Roles 2-10 are reserved": "Roles 2-10 are reserved",
1161
+ "Role IDs 2-10 are reserved": "Role IDs 2-10 are reserved",
1162
+ "Allow offline mode": "Allow offline mode",
1163
+ "Embedded in": "Embedded in",
1164
+ "Linked from": "Linked from",
1165
+ "Table constraints": "Table constraints",
1166
+ "Event logs": "Event logs",
1167
+ "Migrations": "Migrations",
1168
+ "Tag Entries": "Tag Entries",
1169
+ "Not a valid field name": "Not a valid field name"
1170
+ }
package/locales/pl.json CHANGED
@@ -1149,7 +1149,7 @@
1149
1149
  "A page with this name already exists": "Strona z tą nazwą już istnieje",
1150
1150
  "Tenant Base URL": "Bazowy URL tenanta",
1151
1151
  "Base hostname for newly created tenants. If unset, defaults to hostname": "Bazowa nazwa hosta dla nowo utworzonych tenantów. Jeżeli nie ustawione, domyślnie do nazwy hosta",
1152
- "Redirect unathorized": "Przekierowanie nieautoryzowane",
1152
+ "Redirect unauthorized": "Przekierowanie nieautoryzowane",
1153
1153
  "If tenant creation is not authorized, redirect to this URL": "Jeżeli utworzenie tenanta nie jest autoryzowane, przekieruj do tego URL",
1154
1154
  "Import table %s": "Importuj tabelę %s",
1155
1155
  "Import CSV": "Importuj CSV",
package/locales/ru.json CHANGED
@@ -791,7 +791,7 @@
791
791
  "Channels to create events for. Separate by comma; leave blank for all": "Каналы, для которых создаются собятия. Разделяются ; Не заполняйте, чтобы использовать события для всех каналов",
792
792
  "Event Name": "Имя события",
793
793
  "Plugins (Extensions) Store endpoint": "Адрес (endpoint) магазина плагинов",
794
- "Packs Store endpoint": "Адрес (endpoint) магазина паков",
794
+ "Packs Store endpoint": "Адрес (endpoint) Магазина Паков",
795
795
  "The endpoint of plugins store.": "Адрес (endpoint) магазина плагинов.",
796
796
  "The endpoint of packs store.": "Адрес (endpoint) магазина паков.",
797
797
  "Modules": "Модули",
@@ -973,5 +973,41 @@
973
973
  "%s configuration": "%s конфигурация",
974
974
  "Show only matches in table:": "Показывать только совпадения в таблице:",
975
975
  "Role for search": "Роль для поиска",
976
- "Min role to access search page": "Минимальная роль для доступа к странице поиска"
976
+ "Min role to access search page": "Минимальная роль для доступа к странице поиска",
977
+ "Module Store endpoint": "Адрес (endpoint) Магазина Модулей",
978
+ "Force logout": "Принудительный логаут",
979
+ "Disk usage": "Утилизация Дисков",
980
+ "CPU usage": "Утилизация ЦПУ",
981
+ "Mem usage": "Утилизация Памяти",
982
+ "Configure trigger %s": "Настроить триггер %s",
983
+ "Done": "Выполнено",
984
+ "Tenant Base URL": "Базовый URL тенантов",
985
+ "Base hostname for newly created tenants. If unset, defaults to hostname": "Базовое имя хоста для новых тенантов. Если не установлено, то используется текущее",
986
+ "Redirect unauthorized": "Перенаправлять неавторизованных",
987
+ "If tenant creation is not authorized, redirect to this URL": "Если создание тенанта не авторизовано, перенаправлять на указанный URL",
988
+ "Install git plugins": "Устанавливать плагинов из git",
989
+ "Set available npm modules": "Разрешить установку модулей npm",
990
+ "Unsafe modules": "Небезопасные модули",
991
+ "Notifications": "Уведомления",
992
+ "In user menu": "В меню пользователя",
993
+ "Show notifications in the user menu": "Отображать уведомления в меню профиля пользователя",
994
+ "Enabled": "Включено",
995
+ "Progressive Web Application enabled": "Включено Progressive Web Application",
996
+ "Display": "Отображение",
997
+ "Set colors": "Настройка цветов",
998
+ "Theme color": "Цвет темы",
999
+ "Background color": "Цвет фона",
1000
+ "Notification settings": "Настройка уведомлений",
1001
+ "Restore a snapshot": "Восстановить снепшот",
1002
+ "Tenant application capabilities": "Дополнительные возможности Тенанта",
1003
+ "Show configuration object": "Отобразить конфигурацию объекта (raw)",
1004
+ "Connected views": "Связанные представления",
1005
+ "Embedded in": "Встроенно в",
1006
+ "Linked from": "Ссылается из",
1007
+ "First user E-mail": "First user E-mail",
1008
+ "Table constraints": "Констрейнты таблиц",
1009
+ "Sessions": "Сессии",
1010
+ "Event logs": "Лог событий",
1011
+ "Migrations": "Миграции",
1012
+ "Tag Entries": "Экземпляры тегов"
977
1013
  }