日期:2014-05-19  浏览次数:20727 次

关于AnalysisServices的权限问题
AnalysisServices的权限设置十分复杂,用户无法直接操作,我想写一个程序维护   AnalysisServices的权限,各位有什么思路?

------解决方案--------------------
引用DSO對象Microsoft Decision Support Objects

DSO.Server server= new DSO.Server();
DSO.Database db;
DSO.Cube cube;
DSO.Role role;
server.Connect( "LocalHost ");
db = (DSO.Database) server.MDStores.Item( "FoodMart 2000 ");
cube = (DSO.Cube)db.Cubes.Item( "HR ");
role = (DSO.Role)db.Roles.AddNew( "roleTest ",DSO.SubClassTypes.sbclsRegular);
role.LockObject(DSO.OlapLockTypes.olapLockRead, "Create Role ");
sDimensionSecurity = "權限字符串 ";
role.UsersList = "COMPUTER01\\user1 ";
role.SetPermissions( "EnforcementLocation ", "Server ");
role.SetPermissions( "Dimension:Time ", "roleTest ");
if (role.IsValid)
{
role.UnlockObject();
role.Update();
}