How to restrict users from accessing historical data

Hello Beautiful People,
I am wondering if there is any way to restrict users from accessing documents created before a certain date. We need this feature badly.

Thanks in advance for your help.

Currently there is no such way available, but you can freeze your data to not to be edited before a certain date at the most.

What data are they accessing from the history, is it ledgers, is it docs uploaded?

A quick way to do this could be user permissions. Now here it gets tricky.

  1. Create a doctype called month. It’ll have month and year number. Its naming should be {Month}-{YEAR}-{#}.
  2. Add a link field to month doctype on your desired doctype which you want to restrict. Make sure to index this field.
  3. Give user permissions for specific months you want your users to access, and routinely remove older ones.
  4. Try automating step 3 with a cron/scheduler.

Edit: If you want this to be done year wise, there’s already a document called fiscal year.

1 Like

this thread may give you ideas

How to index a field?