Skip to content

Commit e44c953

Browse files
committed
first steps towards having AAD members of roles in Azure Analysis Services show up in Tabular Roles Report
1 parent 49fa626 commit e44c953

3 files changed

Lines changed: 23 additions & 16 deletions

File tree

SQL2017_VS2017_BidsHelper.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
<DebugType>full</DebugType>
6767
<Optimize>false</Optimize>
6868
<OutputPath>bin\Debug\</OutputPath>
69-
<DefineConstants>TRACE;DEBUG;OUTPUT_LOGGER,SQL2016,SQL2017,VS2017</DefineConstants>
69+
<DefineConstants>TRACE;DEBUG;SQL2016,SQL2017,VS2017</DefineConstants>
7070
<ErrorReport>prompt</ErrorReport>
7171
<WarningLevel>4</WarningLevel>
7272
<CopyVsixExtensionFiles>True</CopyVsixExtensionFiles>

SQL2017_VS2017_BidsHelper.sln

Lines changed: 3 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,25 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
33
# Visual Studio 15
4-
VisualStudioVersion = 15.0.26430.12
4+
VisualStudioVersion = 15.0.27130.2036
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SQL2017_VS2017_BidsHelper", "SQL2017_VS2017_BidsHelper.csproj", "{0828F434-598D-4E5B-983A-9FAD3BFDE857}"
77
EndProject
88
Global
99
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1010
Debug|Any CPU = Debug|Any CPU
11-
Debug|x86 = Debug|x86
1211
Release|Any CPU = Release|Any CPU
13-
Release|x86 = Release|x86
1412
EndGlobalSection
1513
GlobalSection(ProjectConfigurationPlatforms) = postSolution
1614
{0828F434-598D-4E5B-983A-9FAD3BFDE857}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
1715
{0828F434-598D-4E5B-983A-9FAD3BFDE857}.Debug|Any CPU.Build.0 = Debug|Any CPU
18-
{0828F434-598D-4E5B-983A-9FAD3BFDE857}.Debug|x86.ActiveCfg = Debug|x86
19-
{0828F434-598D-4E5B-983A-9FAD3BFDE857}.Debug|x86.Build.0 = Debug|x86
2016
{0828F434-598D-4E5B-983A-9FAD3BFDE857}.Release|Any CPU.ActiveCfg = Release|Any CPU
2117
{0828F434-598D-4E5B-983A-9FAD3BFDE857}.Release|Any CPU.Build.0 = Release|Any CPU
22-
{0828F434-598D-4E5B-983A-9FAD3BFDE857}.Release|x86.ActiveCfg = Release|x86
23-
{0828F434-598D-4E5B-983A-9FAD3BFDE857}.Release|x86.Build.0 = Release|x86
2418
EndGlobalSection
2519
GlobalSection(SolutionProperties) = preSolution
2620
HideSolutionNode = FALSE
2721
EndGlobalSection
28-
GlobalSection(TeamFoundationVersionControl) = preSolution
29-
SccNumberOfProjects = 2
30-
SccEnterpriseProvider = {4CA58AB2-18FA-4F8D-95D4-32DDF27D184C}
31-
SccTeamFoundationServer = https://tfs.codeplex.com/tfs/tfs01
32-
SccLocalPath0 = .
33-
SccProjectUniqueName1 = SQL2017_VS2017_BidsHelper.csproj
34-
SccLocalPath1 = .
22+
GlobalSection(ExtensibilityGlobals) = postSolution
23+
SolutionGuid = {17981388-3AA5-4F2F-8A0E-7A94DDCE7D68}
3524
EndGlobalSection
3625
EndGlobal

SSAS/RolesReportPlugin.cs

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ public override void Exec()
311311
dbPerm.Process = (r.Permission == Microsoft.AnalysisServices.BackEnd.DataModelingRolePermission.Refresh || r.Permission == Microsoft.AnalysisServices.BackEnd.DataModelingRolePermission.ReadRefresh);
312312
dbPerm.Read = ((r.Permission == Microsoft.AnalysisServices.BackEnd.DataModelingRolePermission.Read || r.Permission == Microsoft.AnalysisServices.BackEnd.DataModelingRolePermission.ReadRefresh) ? ReadAccess.Allowed : ReadAccess.None);
313313

314-
if (r.Members.Count == 0)
314+
if (r.Members.Count == 0 && r.ExternalMembers.Count == 0)
315315
{
316316
RoleMemberInfo infoMember = new RoleMemberInfo();
317317
infoMember.TargetServerName = _deploymentTargetServer;
@@ -333,6 +333,24 @@ public override void Exec()
333333

334334
listRoleMembers.AddRange(GetGroupMembers(infoMember.directoryEntry, fakeDatabase, fakeRole, 1));
335335
}
336+
foreach (Microsoft.AnalysisServices.BackEnd.DataModelingRoleExternalMember rm in r.ExternalMembers)
337+
{
338+
RoleMemberInfo infoMember = new RoleMemberInfo();
339+
infoMember.TargetServerName = _deploymentTargetServer;
340+
infoMember.database = fakeDatabase;
341+
infoMember.role = fakeRole;
342+
infoMember.MemberName = rm.Name;
343+
344+
//TODO: properly handle AAD members and groups
345+
//infoMember.directoryEntry = GetDirectoryEntry(rm.Name);
346+
//infoMember.MemberName = GetDomainAndUserForDirectoryEntry(infoMember.directoryEntry);
347+
//if (string.IsNullOrEmpty(infoMember.MemberName))
348+
// infoMember.MemberName = rm.Name;
349+
listRoleMembers.Add(infoMember);
350+
351+
//TODO:
352+
//listRoleMembers.AddRange(GetGroupMembers(infoMember.directoryEntry, fakeDatabase, fakeRole, 1));
353+
}
336354

337355
foreach (Microsoft.AnalysisServices.BackEnd.DataModelingTable table in tomTables)
338356
{

0 commit comments

Comments
 (0)