User Rights

skblam
Member Posts: 24
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" />
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" />
0
Comments
-
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.0 -
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" />0 -
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.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions