Skip to content

Commit

Permalink
closes: #5824
Browse files Browse the repository at this point in the history
  • Loading branch information
cotur committed Oct 19, 2020
1 parent ec72106 commit b00abe0
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
Checked="@permission.IsGranted"
CheckedChanged="@(b => PermissionChanged(b, group.Name, permission))"
TValue="bool">
@permission.DisplayName
@GetShownName(permission)
</Check>
</Field>
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,22 @@ private bool IsDisabledPermission(PermissionGrantInfoDto permissionGrantInfo)
{
return _disabledPermissions.Any(x => x == permissionGrantInfo);
}

private string GetShownName(PermissionGrantInfoDto permissionGrantInfo)
{
if (!IsDisabledPermission(permissionGrantInfo))
{
return permissionGrantInfo.DisplayName;
}

return string.Format(
"{0} ({1})",
permissionGrantInfo.DisplayName,
permissionGrantInfo.GrantedProviders
.Where(p => p.ProviderName != _providerName)
.Select(p => p.ProviderName)
.JoinAsString(", ")
);
}
}
}

0 comments on commit b00abe0

Please sign in to comment.