Permissions set with DSO are not the same as in management console -
01-24-2006
, 09:51 AM
I'am tried to set the set the permissions of a dimension for a database role
with DSO.
The code to set the permissions seems to work, because when i start the code
again an read the permissions first, they are the same as I set previously.
But with the Analyisis Managment Console i don't see the same permissions as
with DSO.
The problem does not occur, when I first remove the database role and create
a new one.
Can anybody help me, to solve this "mistery"?
Here's my code
DSO.Server _server = new DSO.Server();
_server.Connect("Server");
DSO.MDStore _database = (DSO.MDStore)_server.MDStores.Item("openControl");
//Adding user
DSO.Role _role;
if (!_database.Roles.Find("TEST"))
{
_role =
(DSO.Role)_database.Roles.AddNew("TEST",DSO.SubCla ssTypes.sbclsRegular);
}
else
{
_role = (DSO.Role)_database.Roles.Item("TEST");
}
UpdateDSObject((DSO.ICommon)_database);
_role.SetPermissions("EnforcementLocation","Server ");
//Restricting dimensions
string dimension = "Dimension:Einheit";
string expression = "<MEMBERSECURITY IsVisible=\"true\"
VisualTotalsLowestLevel=\"[Einheit].[Level 10]\"><PERMISSION Access=\"Read\"
UpperLevel=\"[Einheit].[(All)]\" LowerLevel=\"[Einheit].[Level 10]\"
AllowedSet=\"{[Einheit].&[388]}\"/></MEMBERSECURITY>";
Console.WriteLine(_role.get_Permissions(dimension) );
_role.SetPermissions(dimension,expression);
_role.Update();
_database.Update(); |