dbTalk Databases Forums  

AMO and AllowedSets

microsoft.public.sqlserver.olap microsoft.public.sqlserver.olap


Discuss AMO and AllowedSets in the microsoft.public.sqlserver.olap forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
tjgamble@gmail.com
 
Posts: n/a

Default AMO and AllowedSets - 10-11-2006 , 10:01 AM






Hi,

I'm trying to use AMO to create some roles against an AS 2005 cube.
The following code is pretty much "cut and pasted" from this article on
MSDN.

http://msdn2.microsoft.com/en-us/library/ms345081.aspx

It largely works, in that it creates the role and I can set various
permissions, but importantly for me, the part where you define the
AllowedSet on my Organisation dimension doesn't work. After I run the
script I go to the BI Dev Studio, refresh the db and check the
Dimension Data under my newly created role. All of the child elements
under the "Asset" attribute (level in my hierarchy) are checked, when
I'm expecting to see just one ticked as defined in the set. Has anyone
else attempted this in AMO? I can't find many examples.

The C# code is below.

Thanks

John

Role role = new Role();
role.Name = roleName;
role.Description = desc;

db.Roles.Add(role);
role.Update();

Cube cube = db.Cubes.FindByName(cubeName);

CubePermission cubeperm = cube.CubePermissions.Add(role.ID);
cubeperm.Read = ReadAccess.Allowed;
Dimension dim = db.Dimensions.GetByName("Organisation");
DimensionAttribute attr = dim.Attributes.GetByName("Asset");
CubeDimensionPermission cubedimperm =
cubeperm.DimensionPermissions.Add(dim.ID);
cubedimperm.Read = ReadAccess.Allowed;
AttributePermission attrperm =
cubedimperm.AttributePermissions.Add(attr.ID);
attrperm.AllowedSet = "{[Organisation].[Asset].&[5]}";
cubeperm.Update();


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.