Browse Source

identity server identityresource refactor

pull/1070/head
Yunus Emre Kalkan 8 years ago
parent
commit
c132d46968
  1. 7
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs
  2. 11
      modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs

7
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityClaim.cs

@ -9,7 +9,12 @@ namespace Volo.Abp.IdentityServer.IdentityResources
protected IdentityClaim() protected IdentityClaim()
{ {
}
public virtual bool Equals(Guid identityResourceId, [NotNull] string type)
{
return IdentityResourceId == identityResourceId && Type == type;
} }
protected internal IdentityClaim(Guid identityResourceId, [NotNull] string type) protected internal IdentityClaim(Guid identityResourceId, [NotNull] string type)

11
modules/identityserver/src/Volo.Abp.IdentityServer.Domain/Volo/Abp/IdentityServer/IdentityResources/IdentityResource.cs

@ -1,5 +1,6 @@
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using JetBrains.Annotations; using JetBrains.Annotations;
using Volo.Abp.Domain.Entities; using Volo.Abp.Domain.Entities;
@ -61,5 +62,15 @@ namespace Volo.Abp.IdentityServer.IdentityResources
{ {
UserClaims.Clear(); UserClaims.Clear();
} }
public virtual void RemoveUserClaim(string type)
{
UserClaims.RemoveAll(c => c.Type == type);
}
public virtual IdentityClaim FindUserClaim(string type)
{
return UserClaims.FirstOrDefault(c => c.Type == type);
}
} }
} }

Loading…
Cancel
Save