Add config options to prevent anonymous users from creating pads #704

pull/1/head
yflory 4 years ago
parent d9b9ca680f
commit f5c029e937

@ -134,6 +134,8 @@ define(function() {
// Prevent anonymous users from storing pads in their drive // Prevent anonymous users from storing pads in their drive
AppConfig.disableAnonymousStore = false; AppConfig.disableAnonymousStore = false;
// Prevent anonymous users from creating new pads (they can still access and edit existing ones)
AppConfig.disableAnonymousPadCreation = false;
// Hide the usage bar in settings and drive // Hide the usage bar in settings and drive
//AppConfig.hideUsageBar = true; //AppConfig.hideUsageBar = true;

@ -448,6 +448,9 @@ define([
} }
}; };
funcs.createPad = function (cfg, cb) { funcs.createPad = function (cfg, cb) {
if (AppConfig.disableAnonymousPadCreation && !funcs.isLoggedIn()) {
return void UI.errorLoadingScreen(Messages.mustLogin);
}
ctx.sframeChan.query("Q_CREATE_PAD", { ctx.sframeChan.query("Q_CREATE_PAD", {
owned: cfg.owned, owned: cfg.owned,
expire: cfg.expire, expire: cfg.expire,

Loading…
Cancel
Save