![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
#3
| |||
| |||
|
|
Setting Roles in DSO can be a little bit painful, the basic steps are as follows. 1. Create a database role and assign users/groups and do a .update on that role. 2. Add a cube role with the SAME NAME as the database role. Set the individual cube permissions here. If the role needs access to more than one cube you will need to add it to each cube individually. Call .update on the Cube object to save the changes. I have included some sample code below. You can get a lot more involved with the permissions, setting dimension security, but you have to use the permissions XML string to do this. '================================== Dim dsoServer As DSO.Server Dim dsoDb As DSO.Database Dim dbRole As DSO.Role Dim cubeRole As DSO.Role Dim dsoCube As DSO.Cube '\\ Connect to Server Set dsoServer = New DSO.Server dsoServer.Connect "DARREN01" '\\ Connect to database Set dsoDb = dsoServer.MDStores("Foodmart 2000") '\\ Add a new Database Role and update it Set dbRole = dsoDb.Roles.AddNew("TestRole") dbRole.UsersList = "Everyone" dbRole.Update '\\ Get a reference to a cube Set dsoCube = dsoDb.MDStores("Sales") '\\ Add a cube role - linked to database role by using the same Name Set cubeRole = dsoCube.Roles.AddNew("TestRole") cubeRole.SetPermissions "Access", "RW" '\\ Update the Cube to save the cube role dsoCube.Update dsoDb.Update '\\ Close the server and de-reference variables dsoServer.CloseServer Set dsoCube = Nothing Set dsoDb = Nothing Set dbRole = Nothing Set cubeRole = Nothing Set dsoServer = Nothing '===================================== -- Regards Darren Gosbell [MCSD] dgosbell_at_yahoo_dot_com Blog: http://www.geekswithblogs.net/darrengosbell |
![]() |
| Thread Tools | |
| Display Modes | |
| |