Open glpatcern opened 2 years ago
Thoughts from etherpad discord community (etherpad maintainers):
deleteSession
is only usable when using group pads, but iirc group pads don't have a notion of r/w - always writeable.
A ugly "hack" would be to dynamically block access to /p/. with the exception of `/p/r..and redirect your users to the readonly pad. If you are using authentication plugins at the moment, then you can make use of the
authorizehook. If not, I'd try out plugin
ep_guest- afaik the
userssection in
settings.jsoncan be changed at runtime, enable
requireAuthentication(but not
requireAuthorization) and configure
ep_guestso that all users can write in a pad (
readOnly: false`). Then, if you want to make all pads readonly, dynamically set this to true.
Sorry in case it does not work because users is populated at start up, but iirc I successfully changed this during runtime some time ago.
Reposting here as this contains implementation details:
readonly
have to be declared upfront in thesettings.json
file. / Areadonly
URL can be loaded using the already existingpadID
with the help ofgetReadOnlyID(padID)
function.padID
where the edits can be made, then they would have access to those pads if they went back to that url.A possible solution would be to set a
sessionID
for the editingauthor
once we receive themetadata
contents from thesetefssmetadata
endpoint, then subsequently remove thissessionID
on occurrence of the errors.Maybe something like -
sessionIDs
would be needed to fetched from the database.