Database Reference
In-Depth Information
Scope(
IIF(IsError([Measures].[Sales Amount -
Fact Reseller Sales]),{[Measures].[Sales
Amount]},{[Measures].[Sales
Amount],[Measures].[Sales Amount - Fact
Reseller Sales]}))
);
The IIF function is used together with the VBA function called IsError that
checks if an error message is returned. If no error is found, meaning that the
user has access to both measures, a set containing both of them is used in
the scope. If an error is used, only the [Measures].[Sales Amount] is
used in the scope.
5. Deploy the project and test the functionality of the newly created role.
The role that you have created will limit a user that belongs to the role to only access
the information in the Fact Internet Sales measure group. This method works great
when you have real measures, but not with the calculated measures. To limit ac-
cess to calculated measures, you can either use cell data security or you can follow
the steps described at http://adamjorgensen.wordpress.com/2010/02/21/applying-
security-to-calculated-measures/ .
Implementing data security
The same steps that are used to secure measures can be used when securing data.
Dimension data security can be used to restrict what a user has access to. In the
next examples, we will use dimension data to create two different roles that allow a
user to see data in a specific region. To create the required roles, perform the follow-
ing steps:
1. In the Solution Explorer , right-click on the Roles node and choose New
Role .
2. Right-click on the newly created role file. Change the name of the role to
North America Reader.role . When asked to, change the object name
as well.
Search WWH ::




Custom Search