Exemple #1
0
        /// <summary>
        /// Removes a claim from a user
        /// </summary>
        /// <param name="user">The user</param>
        /// <param name="claim">Claim to remove</param>
        /// <returns>The task representing the asynchronous operation.</returns>
        public Task RemoveClaimAsync(TUser user, Claim claim)
        {
            ThrowIfDisposed();

            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            if (claim == null)
            {
                throw new ArgumentNullException("claim");
            }

            var userClaim = new IdentityClaim(user.Id, claim);

            _storage.UserClaimsTable.RemoveClaim(userClaim);

            return(Task.FromResult <object>(null));
        }
 public void RemoveClaim(IdentityClaim claim)
 {
     _db[_tables.UsersClaims].Delete(UserId: claim.UserId, ClaimType: claim.ClaimType, ClaimValue: claim.ClaimValue);
 }
 public void AddClaim(IdentityClaim claim)
 {
     _db[_tables.UsersClaims].Insert(claim);
 }