User Rights

skblamskblam Member Posts: 24
edited 2002-02-08 in Navision Financials
Hi,

I have a problem in removing access on a menu option.

Case 1, in the General ledger I want to remove access to the Setup Menu. I know that I can hide the menu option and save the menu form in another one.

Case 2 . If the menu option is calling a code unit. How will I prevent the user from having access to that codeunit.

SL. <img border="0" title="" alt="" src="images/smiles/icon_sad.gif" />

Comments

  • wonmowonmo Member Posts: 139
    On the property "Name" of the control, call it something like "SetupBtn". On the OnOpen() trigger of the G/L form add the code:

    CurrForm.SetupBtn.VISIBLE(USERID IN )

    In this case only when either JOHN or MARY are logged in will the Setup button be visible.
  • skblamskblam Member Posts: 24
    Thanks Yang,

    It's working.

    I will have to add (If possible) a column to the User Table specifying if the user is an administator and in the piece of code you gave me, I will have to pass a list of values instead of .

    Do you know how to get a list and pass the list of values?

    I am new in coding with C/AL.

    SL. <img border="0" title="" alt="" src="images/smiles/icon_biggrin.gif" />
  • wonmowonmo Member Posts: 139
    Hi skb,

    There are a few ways to do this. One of them would be to add a field to the user table called HasRights and check if they have permission for the Setup button. So the code would go like this:

    IF UserTable.GET(USERID) THEN
    CurrForm.SetupBtn.VISIBLE(UserTable.HasRights = TRUE);

    You will have to declare the user table as a variable of type record. Another way to do this would be to use the "User Group" and "Member Of" tables to check to see about permissions. This would involve setting up a new group but the user table wouldn't have to be restructured.

    Hope this helps.
Sign In or Register to comment.