Skip to content

Commit

Permalink
Updated claims provider to also set metadata properties such as email…
Browse files Browse the repository at this point in the history
… on roles permissions
  • Loading branch information
Yvand committed Oct 27, 2016
1 parent ac16248 commit b484ce2
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
21 changes: 9 additions & 12 deletions AzureCP/AzureCP.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down Expand Up @@ -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<SPClaim> claims)
{
Augment(context, entity, null, claims);
Expand Down
2 changes: 1 addition & 1 deletion AzureCP/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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")]

0 comments on commit b484ce2

Please sign in to comment.