ArcGIS Desktop

  • ArcGIS Pro
  • ArcMap

  • My Profile
  • 帮助
  • Sign Out
ArcGIS Desktop

ArcGIS Online

专为贵组织打造的制图平台

ArcGIS Desktop

全面的专业性 GIS

ArcGIS Enterprise

面向企业的 GIS

ArcGIS Developers

用于构建位置感知应用程序的工具

ArcGIS Solutions

适用于行业的免费模板地图和应用程序

ArcGIS Marketplace

获取适用于组织的应用程序和数据

  • 文档
  • 支持
Esri
  • 登录
user
  • 我的个人资料
  • 登出

ArcMap

  • 主页
  • 入门
  • 地图
  • 分析
  • 管理数据
  • 工具
  • 扩展模块

Granting privileges to NIS components using a script

Since the NIS XML was imported into the geodatabase, you need to assign permissions in the new NIS workspace to the editor and viewer database roles and assign the roles to the individual users.

注:

对示例进行复制和粘贴可能会导致语法错误。

  1. In SQL Server Management Studio, grant permissions to the NIS workspace tables through the schema.

    The sample script shows how to remove existing members from a role and drop the roles, re-create the roles, and assign permissions to the role through the schema.

    USE [nisdb]
    GO
    EXEC sp_droprolemember 'rlniseditor', 'nis_editor'
    GO
    EXEC sp_droprole 'rlniseditor'
    GO
    EXEC sp_addrole 'rlniseditor', 'nis'
    GO
    GRANT DELETE ON SCHEMA::[nis] TO [rlniseditor]
    GRANT EXECUTE ON SCHEMA::[nis] TO [rlniseditor]
    GRANT INSERT ON SCHEMA::[nis] TO [rlniseditor]
    GRANT SELECT ON SCHEMA::[nis] TO [rlniseditor]
    GRANT UPDATE ON SCHEMA::[nis] TO [rlniseditor]
    GO
    EXEC sp_droprolemember 'rlnisviewer', 'nis_viewer'
    GO
    EXEC sp_droprole 'rlnisviewer'
    GO
    EXEC sp_addrole 'rlnisviewer', 'nis'
    GO
    GRANT SELECT ON SCHEMA::[nis] TO [rlnisviewer]
    GO
    
  2. Use the following script to list the roles so that you can verify them.
    EXEC sp_helprolemember 'rlniseditor'
    GO
    EXEC sp_helprolemember 'rlnisviewer'
    GO
    
  3. Use the following script to list the privileges assigned to the role so that you can verify role permissions.
    select dp.NAME AS principal_name,
     dp.type_desc AS principal_type_desc,
     o.NAME AS object_name,
     p.permission_name,
     p.state_desc AS permission_state_desc 
     from sys.database_permissions p
     left OUTER JOIN sys.all_objects o
     on p.major_id = o.OBJECT_ID
     inner JOIN sys.database_principals dp
     on p.grantee_principal_id = dp.principal_id
     where dp.NAME in ('rlniseditor', 'rlnisviewer')
    GO
    

ArcGIS Desktop

  • 主页
  • 文档
  • 支持

ArcGIS

  • ArcGIS Online
  • ArcGIS Desktop
  • ArcGIS Enterprise
  • ArcGIS
  • ArcGIS Developer
  • ArcGIS Solutions
  • ArcGIS Marketplace

关于 Esri

  • 关于我们
  • 招贤纳士
  • Esri 博客
  • 用户大会
  • 开发者峰会
Esri
分享您的想法。
Copyright © 2021 Esri. | 隐私政策 | 法律声明