mibuso.com

Microsoft Business Solutions online community
It is currently Sat May 18, 2013 1:32 pm

All times are UTC + 1 hour [ DST ]




Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: [Solved] NAV 5 - SQL2005 (Windows Logins) Issue
PostPosted: Thu May 22, 2008 3:06 pm 
Offline

Joined: Tue Aug 28, 2007 5:41 pm
Posts: 352
Location: Cambridge
Country: United Kingdom (uk)
Working on SQL2005/NAV5 [Security Model: Enhanced]

I have noticed strange issue.
If we create a Windows Login in Navision, and synchronize all security, username in sql will be created (with its own schema attached to it).

Let's say we do not give super role to the new user, just some roles to read customer table, etc. After synchronization, when new users logs into navision he is getting error message:


Code: Select all
---------------------------
Microsoft Dynamics NAV
---------------------------
The following SQL Server error(s) occurred while accessing the License Agreement table:

229,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]The SELECT permission was denied on the object 'CRONUS UK Ltd_$License Agreement', database 'Test', schema 'dbo'.

---------------------------
OK   
---------------------------



And let's say we try to open Budgets with same user (for which we do not have permissions). We will get error (instead of - you do not have to read... ):

Code: Select all
---------------------------
Microsoft Dynamics NAV
---------------------------
The following SQL Server error(s) occurred while accessing the G/L Budget Name table:

229,"42000",[Microsoft][ODBC SQL Server Driver][SQL Server]The SELECT permission was denied on the object 'CRONUS UK Ltd_$G_L Budget Name', database 'Test', schema 'dbo'.

---------------------------
OK   
---------------------------


Furthermore, if I would go to SQL and there would add db_owner role, I would get error message (which is actually what i expect to get):

Code: Select all
---------------------------
Microsoft Dynamics NAV
---------------------------
You do not have permission to read the G/L Budget Name table.

---------------------------
OK   
---------------------------


Had anyone else noticed similar issues? Any ideas and discussions would be helpful.


Last edited by Tomas on Fri May 23, 2008 10:38 am, edited 1 time in total.

Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 4:01 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8699
Location: 3rd rock from sun
Country: United States (us)
Every user needs the ALL role in order to login. Have you given that to the user?

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 4:09 pm 
Offline

Joined: Tue Aug 28, 2007 5:41 pm
Posts: 352
Location: Cambridge
Country: United Kingdom (uk)
ara3n wrote:
Every user needs the ALL role in order to login. Have you given that to the user?


Yes, I did.

What I am trying to say is, that instead of normal Navision error that you do not have permissions, I am actually getting SQL error (which is strange).

........

Let's say, if you create a login in SQL first, it will have default schema defined as DBO by default.

If user is created at the moment you synchronize all security, the user will have a default schema named by the user itself.


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 4:47 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8699
Location: 3rd rock from sun
Country: United States (us)
in 2005, the security is stricter, in that if you don't have the select permission, you won't be able to actually see the table.


It is wierd that you are seeing SQL Errors instead of Navision. My guess synchronization didn't finish or is screwed up.
Personally I've given up on enhanced security model.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 5:20 pm 
Offline

Joined: Tue Aug 28, 2007 5:41 pm
Posts: 352
Location: Cambridge
Country: United Kingdom (uk)
ara3n wrote:
in 2005, the security is stricter, in that if you don't have the select permission, you won't be able to actually see the table.


It is wierd that you are seeing SQL Errors instead of Navision. My guess synchronization didn't finish or is screwed up.
Personally I've given up on enhanced security model.


Security was synchronized with user 'sa'. I did not get any error messages while synchronizing. And keeping in mind, that new user was actually created when synchronizing, I am assuming that synchronization was successful.

In SQL2005 probably public role is not good enough with NAV Enhanced security model.

As for synchronization being screwed up - problem is that I was able to replicate same issue on two different machines. ](*,)


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 6:14 pm 
Offline
Moderator
MVP Microsoft Dynamics NAV
NAV TechDays 2013 attendee

Joined: Wed Jul 02, 2003 10:13 am
Posts: 7493
Location: Milan
Country: Italy (it)
[Topic moved from Navision forum to SQL General forum]

Why not use Standard Security model? It makes life a lot easier.

_________________
Regards,Alain Krikilion
Use the SEARCH,Luke! || No PM,please use the forum. || May the <SOLVED>-attribute be in your title! || Read Forum Rules before making a posting


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 6:19 pm 
Offline

Joined: Tue Aug 28, 2007 5:41 pm
Posts: 352
Location: Cambridge
Country: United Kingdom (uk)
kriki wrote:
[Topic moved from Navision forum to SQL General forum]

Why not use Standard Security model? It makes life a lot easier.


It wouldn't be so interesting then... :?

_________________
Tomas,
Dynamics NAV Enthusiast


Top
 Profile  
 
 Post subject:
PostPosted: Thu May 22, 2008 6:41 pm 
Offline
MVP Microsoft Dynamics NAV

Joined: Wed Dec 15, 2004 6:11 pm
Posts: 8699
Location: 3rd rock from sun
Country: United States (us)
Tomas wrote:
kriki wrote:
[Topic moved from Navision forum to SQL General forum]

Why not use Standard Security model? It makes life a lot easier.


It wouldn't be so interesting then... :?


To make it even more interesting, you should open a help ticket with MS.

_________________
Rashed.

blog: http://mibuso.com/blogs/ara3n/


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 23, 2008 3:19 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Thu Jan 02, 2003 6:37 pm
Posts: 7931
Location: Howell, MI
Country: United States (us)
Seriously, why aren't you using standard security? If you need any external apps accessing the NAV database, create users for them manually directly in SQL Server.

_________________
Daniel Rimmelzwaan
MVP - Dynamics NAV


Top
 Profile  
 
 Post subject:
PostPosted: Fri May 23, 2008 10:37 am 
Offline

Joined: Tue Aug 28, 2007 5:41 pm
Posts: 352
Location: Cambridge
Country: United Kingdom (uk)
Possible (and no so possible) solutions to this problem:
1. Add db_owner role to the user (yeah, right - not possible)
2. In the database, find user. Check it's schema. Go find that schema. Change default owner of the schema to dbo (works like a charm, just if there are a lot of users, then there are a lot of clicking in order to solve this issue). And in the future, you will firstly need to create a user in SQL before adding that user into Navision (even if you are creating Windows logins).
3. Change Security model to Standard (which usually everyone goes for). And by everyone I mean myself included.

Thanks for everyone's input, anyways.

_________________
Tomas,
Dynamics NAV Enthusiast


Top
 Profile  
 
 Post subject:
PostPosted: Tue May 27, 2008 2:26 pm 
Offline

Joined: Mon Sep 09, 2002 7:01 am
Posts: 133
Location: Keerbergen (Belgium)
Country: Belgium (be)
ara3n wrote:
It is wierd that you are seeing SQL Errors instead of Navision....



No it's not weird....this is the difference between enhanced and standard security...
Enhanced: SQL wil be in charge of permission to a table. For each user a role will be created and in that role all tables will be present with the correct permissions. Nav clients sends selects etc.. directly to sql who will allow or dissallow according to the role settings.

Standard: One role exists in sql, and that role is used by every users and in that role all permissions on all tables are allowed...

The nav client will check prior to giving the select statement (or alter or delete or whatever) to sql if the user has rights into this table , and if not navision client will block and give the error message....

Stay with the suggestion of everyone here, use always standard security....never enhanced (not seen one example of a client who really needs enhanced security, but seen a lot of problems with it....)

_________________
Rgds
Benny Giebens


Top
 Profile E-mail WWW  
 
 Post subject:
PostPosted: Tue May 27, 2008 10:46 pm 
Offline

Joined: Tue Jun 07, 2005 5:24 pm
Posts: 2573
Location: MA
Country: United States (us)
Sometime ago I asked MS Support to give me an example of a customer where Enhanced Security would be the better choice. They were unable to give me an example. That being said - Use Standard.

_________________
There are no bugs - only undocumented features.


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Wed May 28, 2008 3:41 am 
Offline
MVP Microsoft Dynamics NAV

Joined: Thu Jan 02, 2003 6:37 pm
Posts: 7931
Location: Howell, MI
Country: United States (us)
bbrown wrote:
Sometime ago I asked MS Support to give me an example of a customer where Enhanced Security would be the better choice. They were unable to give me an example. That being said - Use Standard.

From what I understand itis that when Navision was purchased by Microsoft, some MS team did an evaluation of the Navision security system, and found that because the security was not enforced directly on SQL Server, that the system was not secure (or some other words that meant that it did not comply with Microsoft standards), and they forced the NAV team to change the security system to push permissions down into the user level on SQL Server.

I don't remember exactly which version it was, but that is when the 'enhanced' security option was the only option for SQL Server. When that caused problems in just about every single NAV implementation they decided to give back the old security system, and give NAV users the option to select the basic system, and thereby giving the users the responsibility of selecting a "less secure" security system.

_________________
Daniel Rimmelzwaan
MVP - Dynamics NAV


Top
 Profile  
 
 Post subject:
PostPosted: Wed May 28, 2008 3:55 am 
Offline

Joined: Tue Jun 07, 2005 5:24 pm
Posts: 2573
Location: MA
Country: United States (us)
My question to them was not "what it was". I was quite clear on the what. My question to them was "why would one use it". NAV security has always been enforced directly on SQL. It uses SQL Application roles which are a SQL feature and not a NAV feature.

_________________
There are no bugs - only undocumented features.


Top
 Profile E-mail  
 
 Post subject:
PostPosted: Wed May 28, 2008 9:11 am 
Offline

Joined: Mon Sep 09, 2002 7:01 am
Posts: 133
Location: Keerbergen (Belgium)
Country: Belgium (be)
bbrown wrote:
... NAV security has always been enforced directly on SQL. It uses SQL Application roles which are a SQL feature and not a NAV feature...


The use of roles on the standard system, is only there to be able to access the database via a navision client and not directly via a sql login...

So once you have access the security per table is taken over by navision...

I think it's only how you put it, but imho when using standard, it's the navision client that enforces the real security....

_________________
Rgds
Benny Giebens


Top
 Profile E-mail WWW  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 30 posts ]  Go to page 1, 2  Next

All times are UTC + 1 hour [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum


Search for:
Jump to: