简体   繁体   English

使用Navision妥善处理sql-server权限

[英]Handle sql-server permissions gracefully with Navision

Background 背景

I am in the process of creating an application (referred to as MyApp) which must read data out from a SQL Server database handled by Navision. 我正在创建一个应用程序(称为MyApp),该应用程序必须从Navision处理的SQL Server数据库中读取数据。 Navision users should to be able to use my application, without modifying permissions in the database. Navision用户应该能够使用我的应用程序,而无需修改数据库中的权限。

Navision's handling of permissions seems to be on the application layer. Navision的权限处理似乎在应用程序层上。 It performs the checking of permissions without storing them in the database. 它执行权限检查,而不将其存储在数据库中。

Problem 问题

Navision overwrites users, permissions, and other related objects in the database when synchronizing with the database, so the normal approach of creating a DB user and just using that won't work. 与数据库同步时,Navision会覆盖数据库中的用户,权限和其他相关对象,因此创建数据库用户并仅使用它的常规方法将行不通。

Possible Solution 可能的解决方案

What I think would be the most appropriate solution is to create a MyApp role in Active-Directory, which grants the necessary permissions on the DB, and add this role to all users. 我认为最合适的解决方案是在Active-Directory中创建MyApp角色,该角色将授予DB必要的权限,并将此角色添加到所有用户。

I do not know how to do this, or even if it's possible. 我不知道该怎么做,甚至可能。 Other solutions, or proposals, are welcome, but please only suggest solutions with can be managed from within ActiveDirectory or Navision. 欢迎使用其他解决方案或建议,但仅建议可以在ActiveDirectory或Navision中管理的解决方案。

The server is an SQL Server 2008 server running Navison 5, and the client is Navision 6. I'm using Active Directory for Windows Server 2K8. 该服务器是运行Navison 5的SQL Server 2008服务器,客户端是Navision6。我正在将Active Directory用于Windows Server 2K8。

EDIT: 编辑:

My app is a crate creating and designing application. 我的应用程序是一个创建和设计应用程序的箱子。 It needs to read out the customers' names and IDs, and a few items in the items table, and that is why I need this functionality 它需要读出客户的名称和ID,以及项目表中的一些项目,这就是为什么我需要此功能

If you use the enhanced security model in NAV, user permissions are synchronized to SQL Server. 如果在NAV中使用增强的安全模型,则用户权限将同步到SQL Server。 However, these SQL permissions are mapped to an app role in SQL Server, rather than the user's login. 但是,这些SQL权限映射到SQL Server中的应用程序角色,而不是用户的登录名。 If you use the standard security model, all users map to a single SQL app role which is a super user (less secure). 如果使用标准安全模型,则所有用户都将映射到一个SQL应用程序角色,该角色是超级用户(不太安全)。

If you want to access the data in SQL Server using the NAV security model (ie through the SQL App roles NAV creates), you should use the CFront API (installed via the SDK option). 如果要使用NAV安全模型访问SQL Server中的数据(即通过NAV创建的SQL App角色),则应使用CFront API(通过SDK选项安装)。 If you are using NAV 2009 web services are also an option. 如果您使用的是NAV 2009 Web服务,则也可以选择。

If you want to access SQL Server directly, then you will have to manage the permissions yourself using SQL Server. 如果要直接访问SQL Server,则必须使用SQL Server自己管理权限。 If you create a SQL script to grant permission it is easy to restore anything which NAV might delete during Synchronize Logins. 如果您创建一个SQL脚本来授予权限,则很容易恢复在同步登录期间NAV可能删除的任何内容。

You can't grant SQL permission from Active Directory exactly as you described. 您不能完全按照您描述的那样从Active Directory中授予SQL权限。 Instead you must map Active Directory groups to either SQL Server logins or NAV Windows Logins (depending on whether you decide to access SQL directly or go through a supported NAV API). 相反,您必须将Active Directory组映射到SQL Server登录名或NAV Windows登录名(取决于您决定直接访问SQL还是通过受支持的NAV API)。 Note: the permissions associated with the role are managed in SQL or NAV respectively; 注意:与角色关联的权限分别通过SQL或NAV进行管理; not in AD. 不在公元。

From an administration perspective, you can simply add and remove users from this Active Directory group. 从管理角度来看,您可以简单地在此Active Directory组中添加和删除用户。 If you use the NAV enhanced security model each user in the AD group must also have an entry in Windows Logins, and whenever you make changes you must Synchronize Logins. 如果使用NAV增强的安全模型,则AD组中的每个用户还必须在Windows登录名中包含一个条目,并且每当进行更改时,都必须同步登录名。 This slight inconvenience is a hangover from the native database. 这种轻微的不便是本机数据库的一个困扰。

In general, skipping the NAV layer and reading/writing directly to the DB is not recommended at all as you're bypassing all of NAVs business logic which is stored in the table and report objects in NAV. 通常,完全不建议跳过NAV层并直接对DB进行读/写操作,因为您将绕过存储在表和NAV中的报表对象中的所有NAV业务逻辑。

What does your app intend to do (broad strokes if you can't get specific) and would using a NAV add-in or dataport be feasible? 您的应用打算做什么(如果您无法具体说一下,请大招),使用NAV加载项或数据端口是否可行?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM