mirror of
https://github.com/cryptpad/cryptpad.git
synced 2026-09-14 11:05:41 +05:00
Allow password change for all OO apps
This commit is contained in:
parent
71e34a6c00
commit
fa5ce220f5
@ -27,7 +27,7 @@ const factory = (AppConfig = {}, ApiConfig = {},
|
||||
setCustomize({AppConfig,ApiConfig});
|
||||
}
|
||||
|
||||
const Types = { setCustomize };
|
||||
const Types = { OO_APPS, setCustomize };
|
||||
|
||||
Types.__defineGetter__("availableTypes", function () {
|
||||
if (ApiConfig.appsToDisable) {
|
||||
|
||||
@ -19,13 +19,14 @@ define([
|
||||
'/common/common-credential.js',
|
||||
'/customize/login.js',
|
||||
'/common/store-interface.js',
|
||||
'/common/pad-types.js',
|
||||
|
||||
'/customize/application_config.js',
|
||||
'/components/nthen/index.js',
|
||||
'/components/tweetnacl/nacl-fast.min.js'
|
||||
], function (Config, Broadcast, Messages, Util, Hash, Cache,
|
||||
Constants, Feedback, Visible, UserObject, LocalStore, Channel, Block,
|
||||
Cred, Login, Store, AppConfig, nThen) {
|
||||
Cred, Login, Store, Types, AppConfig, nThen) {
|
||||
|
||||
/* This file exposes functionality which is specific to Cryptpad, but not to
|
||||
any particular pad type. This includes functions for committing metadata
|
||||
@ -1689,7 +1690,7 @@ define([
|
||||
if (!href) { return void cb({ error: 'EINVAL_HREF' }); }
|
||||
var parsed = Hash.parsePadUrl(href);
|
||||
if (!parsed.hash) { return void cb({ error: 'EINVAL_HREF' }); }
|
||||
if (parsed.type !== 'sheet') { return void cb({ error: 'EINVAL_TYPE' }); }
|
||||
if (!Types.OO_APPS.includes(parsed.type)) { return void cb({ error: 'EINVAL_TYPE' }); }
|
||||
|
||||
var warning = false;
|
||||
var newHash, newRoHref;
|
||||
|
||||
@ -8,11 +8,12 @@ define([
|
||||
'/common/common-hash.js',
|
||||
'/common/common-interface.js',
|
||||
'/common/common-ui-elements.js',
|
||||
'/common/pad-types.js',
|
||||
'/common/inner/common-modal.js',
|
||||
'/common/hyperscript.js',
|
||||
'/customize/messages.js',
|
||||
'/components/nthen/index.js',
|
||||
], function ($, Util, Hash, UI, UIElements, Modal, h,
|
||||
], function ($, Util, Hash, UI, UIElements, Types, Modal, h,
|
||||
Messages, nThen) {
|
||||
var Access = {};
|
||||
|
||||
@ -908,7 +909,7 @@ define([
|
||||
// We should know it because the pad is stored, but it's better to check...
|
||||
//if (!data.noEditPassword && !opts.noEditPassword && owned && data.href) {
|
||||
if (!data.noEditPassword && !opts.noEditPassword && owned && data.href && parsed.type !== "form") { // TODO password change in forms block responses (validation & decryption)
|
||||
var isOO = ['sheet', 'doc', 'presentation'].includes(parsed.type);
|
||||
var isOO = Types?.OO_APPS?.includes(parsed.type);
|
||||
var isFile = parsed.hashData.type === 'file';
|
||||
var isSharedFolder = parsed.type === 'drive';
|
||||
|
||||
|
||||
@ -27,7 +27,7 @@ const factory = (AppConfig = {}, ApiConfig = {},
|
||||
setCustomize({AppConfig,ApiConfig});
|
||||
}
|
||||
|
||||
const Types = { setCustomize };
|
||||
const Types = { OO_APPS, setCustomize };
|
||||
|
||||
Types.__defineGetter__("availableTypes", function () {
|
||||
if (ApiConfig.appsToDisable) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user