From b484ce25020b5f14f5c0f72c15450f8c8f032ba1 Mon Sep 17 00:00:00 2001 From: Yvan Duhamel Date: Thu, 27 Oct 2016 15:54:10 +0200 Subject: [PATCH] Updated claims provider to also set metadata properties such as email on roles permissions --- AzureCP/AzureCP.cs | 21 +++++++++------------ AzureCP/Properties/AssemblyInfo.cs | 2 +- 2 files changed, 10 insertions(+), 13 deletions(-) diff --git a/AzureCP/AzureCP.cs b/AzureCP/AzureCP.cs index 01f9270d..ca006f66 100644 --- a/AzureCP/AzureCP.cs +++ b/AzureCP/AzureCP.cs @@ -863,19 +863,16 @@ protected virtual PickerEntity CreatePickerEntityHelper(AzurecpResult result) //pe.EntityGroupName = ""; int nbMetadata = 0; - if (result.AzureObject.ClaimEntityType == SPClaimEntityTypes.User) + // Populate metadata attributes of permission created + foreach (var entityAttrib in ProcessedAzureObjectsMetadata) { - // Populate metadata attributes of permission created - foreach (var entityAttrib in ProcessedAzureObjectsMetadata) + // if there is actally a value in the GraphObject, then it can be set + string entityAttribValue = GetGraphPropertyValue(result.DirectoryObjectResult, entityAttrib.GraphProperty.ToString()); + if (!String.IsNullOrEmpty(entityAttribValue)) { - // if there is actally a value in the GraphObject, then it can be set - string entityAttribValue = GetGraphPropertyValue(result.DirectoryObjectResult, entityAttrib.GraphProperty.ToString()); - if (!String.IsNullOrEmpty(entityAttribValue)) - { - pe.EntityData[entityAttrib.EntityDataKey] = entityAttribValue; - nbMetadata++; - LogToULS(String.Format("[{0}] Added metadata \"{1}\" with value \"{2}\" to permission", ProviderInternalName, entityAttrib.EntityDataKey, entityAttribValue), TraceSeverity.Verbose, EventSeverity.Information, AzureCPLogging.Categories.Claims_Picking); - } + pe.EntityData[entityAttrib.EntityDataKey] = entityAttribValue; + nbMetadata++; + LogToULS(String.Format("[{0}] Added metadata \"{1}\" with value \"{2}\" to permission", ProviderInternalName, entityAttrib.EntityDataKey, entityAttribValue), TraceSeverity.Verbose, EventSeverity.Information, AzureCPLogging.Categories.Claims_Picking); } } @@ -1027,7 +1024,7 @@ protected override void FillClaimsForEntity(Uri context, SPClaim entity, SPClaim { Augment(context, entity, claimProviderContext, claims); } - + protected override void FillClaimsForEntity(Uri context, SPClaim entity, List claims) { Augment(context, entity, null, claims); diff --git a/AzureCP/Properties/AssemblyInfo.cs b/AzureCP/Properties/AssemblyInfo.cs index 4d9e88e0..f9693658 100644 --- a/AzureCP/Properties/AssemblyInfo.cs +++ b/AzureCP/Properties/AssemblyInfo.cs @@ -34,5 +34,5 @@ // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] [assembly: AssemblyVersion("1.0.0.0")] -[assembly: AssemblyFileVersion("2.7")] +[assembly: AssemblyFileVersion("2.8")]