Forum Discussion
Clampazzo
Resolver I
2 years agoCan I add a role for RLS Using XMLA Endpiont and C#?
I have managed to create a new semantic model using XMLA Endpoint and C# but now I need to be able to create Roles for RLS using the same method. Is this allowed? And if so How can I go about doing it?
Below is my simple code in creating the semantic model.
If I can call a REST API tha twould work too... I just didn't see any that would work.
string newDatabaseName = server.Databases.GetNewName(DatabaseName);
var database = new Microsoft.AnalysisServices.Database()
{
Name = newDatabaseName,
ID = newDatabaseName,
CompatibilityLevel = 1520,
StorageEngineUsed = Microsoft.AnalysisServices.StorageEngineUsed.TabularMetadata,
Model = new Model()
{
Name = DatabaseName + "-Model",
Description = "A Demo Tabular data model with 1520 compatibility level."
}
};
server.Databases.Add(database);
database.Update(Microsoft.AnalysisServices.UpdateOptions.ExpandFull);
6 Replies
- Clampazzo
Resolver I
Thanks for the reply GilbertQ , while that would be easy to do I need to dynamically create these datasets. They will all be DirectQuery but I am creating a new dataset (sometimes multiple) per client workspace. So going in manually later would be difficult to do.
If there's a way to copy a template dataset and then modify it using xmla (while keeping roles) that would be acceptable too.