create an etherpad for x minutes and after x minutes the same etherpad should be in readonly mode

138 views Asked by At

I am new to etherpad and it's very interesting. i need an etherpad to be created with API only

  1. only admin should be able to create the etherpad.
  2. the etherpad should be active only for x minutes (like 40min).
  3. after x minutes the same etherpad should become read-only.

Can anyone help me out

1

There are 1 answers

1
Pankaj Chejara On

I have been doing the similar thing. I think i might help here a bit.

You can check the detailed instructions here

Following are the steps you need to take to achieve what you have mentioned in your questions

  1. only admin should be able to create the etherpad.

You need to change the editOnly and requireSession property to true in settings.json file.

  1. the etherpad should be active only for x minutes

For this, first you need to create a group using createGroup function. This function will give you groupID that you can use to create group pad using createGroupPad function. Once you have created the group pad, you need to create a session to allow access to that pad. You can create session using createSession function which requires three arguments: authorID, groupID and validUntil. In validUntil you can specify the unix timestamp in seconds till when you want to allow access to the pad.

3.after x minutes the same etherpad should become read-only.

You can store the pad creation time in your db. When someone access the pad after the 40 minutes, you can provide access to the pad with read only pad id. You can use readOnly function.