import: Replace the allowAnyoneToImport check with userCanModify

This reduces the number of hoops a user or tool must jump through to
import.
This commit is contained in:
Richard Hansen 2020-10-01 15:49:04 -04:00 committed by John McLear
parent 831528e8bc
commit a8cf434d1d
11 changed files with 143 additions and 109 deletions

View file

@ -942,16 +942,6 @@ async function handleClientReady(client, message, authorID)
});
}));
let thisUserHasEditedThisPad = false;
if (historicalAuthorData[authorID]) {
/*
* This flag is set to true when a user contributes to a specific pad for
* the first time. It is used for deciding if importing to that pad is
* allowed or not.
*/
thisUserHasEditedThisPad = true;
}
// glue the clientVars together, send them and tell the other clients that a new one is there
// Check that the client is still here. It might have disconnected between callbacks.
@ -1135,8 +1125,6 @@ async function handleClientReady(client, message, authorID)
"percentageToScrollWhenUserPressesArrowUp": settings.scrollWhenFocusLineIsOutOfViewport.percentageToScrollWhenUserPressesArrowUp,
},
"initialChangesets": [], // FIXME: REMOVE THIS SHIT
"thisUserHasEditedThisPad": thisUserHasEditedThisPad,
"allowAnyoneToImport": settings.allowAnyoneToImport
}
// Add a username to the clientVars if one avaiable