1

Prevent old record editing for users with limited access rights

Hello!


I have 2 access rights levels in my db - admin and manager, where manager has less rights.

How can i prevent a manager to change anything in an old record, for example of yesterday and before that?

I want him to be able to create and edit only today's records.
 

Thank you!

Agassi

7 replies

null
    • John_Halls
    • 1 yr ago
    • Reported - view

    Hi Agassi

    There are "fields" called 'Modified by', 'Modified on' and 'Created by' (and its alternative _md). To access them they have to included in a formula field. I don't think there's a 'Created on' (its alternative _cd wouldn't work for me).

    To get over this and have full control of your set-up I would add a date field called DateCreated. Set the Default value to Today. In the Writable if section of the table have code along the lines of

    userRole() = "admin" or DateCreated = today()

    This will also have to be done for any child records as this alone will not prevent those from being changed.

    Regards John

      • Paul_Chappell
      • 1 yr ago
      • Reported - view

      John Halls Agassi Yes.  'Created on' is an inbuilt date function.

      • Agassi
      • 1 yr ago
      • Reported - view

      John Halls Thank you very much!

      I will try it and report back!

      • Agassi
      • 1 yr ago
      • Reported - view

      Paul Chappell Paul, can it be accessed in formulas or "Writable if" field?

      • Paul_Chappell
      • 1 yr ago
      • Reported - view

      Agassi Yes.  Anywhere.

      • Agassi
      • 1 yr ago
      • Reported - view

      Paul Chappell I could not make use of that field in formula. It does not work.

      Will better post a new question about that, for easier access for others.

      • Paul_Chappell
      • 1 yr ago
      • Reported - view

      Agassi Yes.  'Created on' includes the time. So instead, in your record (or field) "Writable if..." use this:

      userRole() = "admin" or date('Created on') = today()

      The record (or field) will only be writable if you have a role of "admin" or if the record was created anytime 'today'.

Content aside

  • 1 Likes
  • 1 yr agoLast active
  • 7Replies
  • 101Views
  • 3 Following