The standard permission setup handles if you have permission to the table or not. So no need to do any code here. If you, like I have done several times, want to disable specific fields or functions based on a users access to another table then you need to code it.
It’s done i little different if you are using pre-2013 versions or NAV 2013.
If you’re using one of the “classic versions” then you need to filter on the users SID in the “Windows Access Control” table (no. 2000000053I for users using Windows Authentication and filter on “User ID” in the “Member Of” table (no. 2000000003) for Database Authentication. You find the users SID in the Windows Login table (no. 2000000054).
For NAV 2013 you must filter on the users security GUID in the Access Control table (no. 2000000053). The User Security GUID is found in the User table (no. 2000000120).