在上文中,我们简单回顾了Analysis Services(以下简称AS,邀月注)的角色和windows用户组等有关管理安全的基础知识,本文将继续关注数据安全(Data Security)。
二、Analysis Services安全功能(续一)
5、数据安全(Data Security)
可以实现三种不同类型的数据安全性:我们可以授予角色以访问整个cube的成员的权限;我们可以授予对一个Cube数据的访问,可以拒绝访问单个Cell(Cell安全),或者维度结构层次上的个别成员(Dimension安全)。
(1)对Cube授予读权限
用户访问一个Cube中的任何数据之前,他们必须是一个对该Cube具有读取权限的角色成员。通过如下界面授予读权限。
如果设置了Cube上的写回(WriteBack),我们还可以控制角色是否可以写回Cube的授予读/写权限。最后,如果我们想要角色成员,能够运行钻取查询和创建本地Cube,我们可以授予权限“Local Cube/Drillthrough Access”。
(2)Cell安全
Cell的安全性配置使用三个MDX表达式返回布尔值。这三个表达式,让我们定义哪些Cube的Cell可以被读或写回。Cube中的每一个Cell被评估,如果返回true,那么我们可以读取或写入cell,如果返回false,则不。
我们看一个例子,如果,我们在Role编辑界面,检查Cell数据选项卡是否启用“read”权限,输入如下表达式:
[Sales Territory].[Sales Territory Country].CurrentMember IS [Sales Territory].[Sales Territory Country].&[Canada]
这样,用户将只能看到Sales Territory维度中Sales Territory Country层次的当前成员是Canada的Cell。在该角色下,我们查询Cube,如下:
这个结果表明:
A:即便角色只能访问加拿大的数据,但还是看到了其他国家,只是不能访问的数据用Null代替,当然也可以用#N/A。这可以在"Secured Cell Value"中设置。
B:授予访问一个国家也授予访问该该国的所有地区。这是因为国家和地区之间有一个定义的属性关系,所以,当选择一个国家的CurrentMember在查询时因为地区的变化引起地区所在的国家的变化。授予属性的成员访问权限,将会同时授予与该属性有直接或间接的关系的低颗粒度属性,但不会发生在更高的颗粒度属性,所以North American成员和总计(这是在层次结构中的所有成员),不能访问。
最后这一点引发了另一个问题:如果该角色的用户从Sales Territory没有选择任何选项而查询Cube会发生什么?
我们看下图:
这是因为:默认成员是All Members,无权限访问,而选择"Canada"时可以读取。
Cell级别的安全控制也可用于度量。例如,读权限使用这个表达式:
([Measures].CurrentMember IS [Measures].[Sales Amount])
OR
([Measures].CurrentMember IS [Measures].[Tax Amount])
该条件过滤后的效果如下:
如果我们希望进一步,用户能够看到所有的国家的Sales Amount,但Total Product Cost仅限于加拿大,我们可以使用:
[Measures].CurrentMember IS [Measures].[Sales Amount]
OR (
[Measures].CurrentMember IS [Measures].[Total Product Cost]
AND
[Sales Territory].[Sales Territory Country].CurrentMember
IS [Sales Territory].[Sales Territory Country].&[Canada]
) OR
[Measures].CurrentMember IS [Measures].[Gross Profit]
注意因为Gross Profit=Sales Amount-Total Product Cost这个计算关系,所以实际上这三个字段都是可见的。
那么如何真正控制,让Gross Profit的读取权限完全符合我们的预期呢?关键的一步在于上述的表达式不应写在"Read Permissions",而应该写在"Read-Contigent Permissions"中
本文主要学习Cube的读取和Cell安全,下节将继续了解数据安全(Data Security)中的维度安全和如何应用安全到度量,欢迎关注。
邀月注:本文版权由邀月和CSDN共同所有,转载请注明出处。
助人等于自助! 3w@live.cn
分享到:
相关推荐
### 专业知识点总结:《Expert Cube Development with Microsoft SQL Server 2008 Analysis Services》 #### 一、设计与实施快速、可扩展且易于维护的多维数据集(Cube) 在《Expert Cube Development with ...
《专家级立方体开发与Microsoft SQL Server 2008分析服务》一书深入探讨了在数据仓库和商业智能(BI)领域内如何利用Microsoft SQL Server 2008 Analysis Services设计、实施快速、可扩展且易于维护的多维数据集(即...
《使用Microsoft SQL Server 2008 Analysis Services进行专家级立方体开发》是一本全面而实用的指南,适合希望深入了解并掌握SQL Server 2008 Analysis Services中多维数据集设计与开发的人员阅读。通过本书的学习,...
本书《Expert Cube Development with MS SQL Server 2008 SSAS》旨在为读者提供关于如何利用Microsoft SQL Server 2008 Analysis Services(SSAS)设计和实现高效、可扩展且易于维护的数据立方体(Cubes)的深入指导...
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
《Expert Cube Development with SSAS Multidimensional Models》是关于使用SQL Server Analysis Services(SSAS)构建多维数据集的专业指南。这本书深入探讨了如何利用SSAS进行高效且复杂的立方体开发,以支持企业...
《Expert Cube Development with SSAS Multidimensional Models》是由Chris Webb、Alberto Ferrari和Marco Russo共同编写的关于SQL Server分析服务(SSAS)多维模型开发的专业书籍。本书是第二版,首次出版于2009年7...
《Microsoft SQL Server 2012 Integration Services: An Expert Cookbook》是一本由Reza Rad和Pedro Perfeito合著的关于微软SQL Server 2012集成服务(Integration Services,简称SSIS)的专业食谱式教程书籍。...
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
This title serves as an authoritative guide to Microsofts new "SQL Server 2012 Analysis Services" BI product and is written by key members of the Microsoft Analysis Services product development team....
Build and manage data integration solutions with expert guidance from the Microsoft SQL Server Integration Services (SSIS) team. See best practices in action and dive deep into the SSIS engine, SSISDB...