Skip to content

Commit

Permalink
Small fix to legacy search, and make entity framework logs less exces…
Browse files Browse the repository at this point in the history
…sive (#551)
  • Loading branch information
Ceredron authored Dec 10, 2024
1 parent 4d17828 commit 67a878a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion src/Altinn.Correspondence.API/appsettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning"
"Microsoft.AspNetCore": "Warning",
"Microsoft.EntityFrameworkCore": "Warning"
}
},
"AllowedHosts": "*"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,17 @@ private static XacmlJsonCategory CreateResourceCategory(string resourceId, Claim

resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(AltinnXacmlUrns.ResourceId, resourceId, DefaultType, DefaultIssuer));

if (party.IsOrganizationNumber())
if (party.WithoutPrefix().IsOrganizationNumber())
{
resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(UrnConstants.OrganizationNumberAttribute, party, DefaultType, DefaultIssuer));
resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(UrnConstants.OrganizationNumberAttribute, party.WithoutPrefix(), DefaultType, DefaultIssuer));
}
else if (party.IsSocialSecurityNumber())
else if (party.WithoutPrefix().IsSocialSecurityNumber())
{
resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(UrnConstants.PersonIdAttribute, party, DefaultType, DefaultIssuer));
resourceCategory.Attribute.Add(DecisionHelper.CreateXacmlJsonAttribute(UrnConstants.PersonIdAttribute, party.WithoutPrefix(), DefaultType, DefaultIssuer));
}
else
{
throw new InvalidOperationException("RecipientId is not a valid organization or person number");
throw new InvalidOperationException("RecipientId is not a valid organization or person number: " + party);
}
if (instanceId is not null)
{
Expand Down

0 comments on commit 67a878a

Please sign in to comment.