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

7replies Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
    • John Halls
    • John_Halls
    • 2 mths 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

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

      Like
      • Agassi
      • Agassi
      • 2 mths ago
      • Reported - view

      John Halls Thank you very much!

      I will try it and report back!

      Like
      • Agassi
      • Agassi
      • 2 mths ago
      • Reported - view

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

      Like
    • Agassi Yes.  Anywhere.

      Like
      • Agassi
      • Agassi
      • 2 mths 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.

      Like
    • 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'.

      Like
Like1 Follow
  • 1 Likes
  • 2 mths agoLast active
  • 7Replies
  • 60Views
  • 3 Following