From 21e863896c75ae16691e1f4dae1561def6cc49fe Mon Sep 17 00:00:00 2001 From: Vincent Date: Mon, 7 Oct 2019 10:38:23 +0200 Subject: [PATCH 1/2] Revert "Remove code that's unused according to @timbl" This reverts commit 5afb141378f195f395f249258a7fd02768334ada. --- src/acl-control.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/acl-control.js b/src/acl-control.js index e11dd9ef8..cb121ac88 100644 --- a/src/acl-control.js +++ b/src/acl-control.js @@ -94,8 +94,11 @@ UI.aclControl.ACLControlBox5 = function (subject, dom, noun, kb, callback) { // There are two of these in all iff the defaults are separate // function ACLControlEditable (box, doc, aclDoc, kb, options) { + var defaultOrMain = options.doingDefaults ? 'default' : 'main' options = options || {} + var ac = UI.acl.readACL(doc, aclDoc, kb, options.doingDefaults) // Note kb might not be normal one var byCombo + box[defaultOrMain] = byCombo = UI.acl.ACLbyCombination(ac) var kToCombo = function (k) { var y = ['Read', 'Append', 'Write', 'Control'] var combo = [] From ba8e22337b532e72eff26887c174863e561e51fa Mon Sep 17 00:00:00 2001 From: Arne Hassel Date: Thu, 7 Nov 2019 10:07:32 +0100 Subject: [PATCH 2/2] Removing use doingDefaults, but keeping byCombo --- src/acl-control.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/acl-control.js b/src/acl-control.js index cb121ac88..6944159d7 100644 --- a/src/acl-control.js +++ b/src/acl-control.js @@ -93,12 +93,10 @@ UI.aclControl.ACLControlBox5 = function (subject, dom, noun, kb, callback) { // This is the main function which produces an editable access control. // There are two of these in all iff the defaults are separate // - function ACLControlEditable (box, doc, aclDoc, kb, options) { - var defaultOrMain = options.doingDefaults ? 'default' : 'main' - options = options || {} + function ACLControlEditable (box, doc, aclDoc, kb, options = {}) { var ac = UI.acl.readACL(doc, aclDoc, kb, options.doingDefaults) // Note kb might not be normal one - var byCombo - box[defaultOrMain] = byCombo = UI.acl.ACLbyCombination(ac) + var byCombo = UI.acl.ACLbyCombination(ac) // important to keep this, as removal will trigger bugs like https://github.com/solid/solid-panes/issues/193#issuecomment-549777549 + var kToCombo = function (k) { var y = ['Read', 'Append', 'Write', 'Control'] var combo = [] @@ -111,6 +109,7 @@ UI.aclControl.ACLControlBox5 = function (subject, dom, noun, kb, callback) { combo = combo.join('\n') return combo } + var colloquial = {13: 'Owners', 9: 'Owners (write locked)', 5: 'Editors', 3: 'Posters', 2: 'Submitters', 1: 'Viewers'} var recommended = {13: true, 5: true, 3: true, 2: true, 1: true} var explanation = {