Catch and log "you do not have permission to"

KraverKraver Member Posts: 17
Hello,

I would like to develop a tool to help me at defining user roles.
for example: A user wants to open the G/L account. He gets the message "You do not have permission to read table G/L Account..."
When this happens I would like for Navision to log this in a new table:
User-id Data Type No. Permission Denied
User1 table 15 Read

I've been looking for this in my spare time, but I don't believe it is possble.

TL DR: Is it possible to catch this error before it happens and log it?

Thanks in advance!

Comments

  • IsitarIsitar Member Posts: 29
    I don't know if this helps you but you could create a single instance codeunit with a timer in it.
    In the timer you can call the function GETLASTERRORTEXT and save it in a table.
    Greetings from Switzerland
  • KraverKraver Member Posts: 17
    Thank you for your reply, I will try it and post my findings.
  • vaprogvaprog Member Posts: 1,141
    To get a one-time logging per session you may utilize the GetGlobalTableTriggerMask or GetDatabaseTableTriggerSetup in codeunit 1. There are some caveats about this, however. These triggers get called on first use of a table, regardless of kind of access, so you can't detect when an actual non-permitted access is attempted.
    Given the user has full access initially, you may try to use the OnDatabase... triggers to log access.
  • David_SingletonDavid_Singleton Member Posts: 5,479
    Or instead of trying to invent a square wheel, why not use a round one that already exists:

    http://www.naveasysecurity.com/

    :mrgreen:
    David Singleton
  • ara3nara3n Member Posts: 9,256
    Here is a how to log users errors.

    http://mibuso.com/blogs/ara3n/2008/05/2 ... -navision/
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
Sign In or Register to comment.