public void RemoveScope(int scopeId) { var scopeToRemove = Scopes.FirstOrDefault(s => s.ScopeId == scopeId); if (scopeToRemove != null) { Scopes.Remove(scopeToRemove); } }
public void RemoveNamedScope(string scopeName) { var scope = GetScope(scopeName); if (!string.IsNullOrWhiteSpace(scope)) { _namedScopes.Remove(scopeName); Scopes.Remove(scope); } }
public void RemoveScope(string scope) { if (!string.IsNullOrWhiteSpace(scope)) { foreach (var item in _namedScopes.Where(kvp => kvp.Value == scope).ToList()) { _namedScopes.Remove(item.Key); } Scopes.Remove(scope); } }
public void RemovePolicy(string policy) { if (!string.IsNullOrWhiteSpace(policy)) { foreach (var item in _namedPolicies.Where(kvp => kvp.Value == policy).ToList()) { _namedPolicies.Remove(item.Key); } Scopes.Remove(policy); } }
public async Task <IdentityServiceResult> RemoveScopeAsync(TApplication application, string scope, CancellationToken cancellationToken) { cancellationToken.ThrowIfCancellationRequested(); ThrowIfDisposed(); if (application == null) { throw new ArgumentNullException(nameof(application)); } if (scope == null) { throw new ArgumentNullException(nameof(scope)); } var existingScope = await Scopes .SingleAsync(ru => ru.ApplicationId.Equals(application.Id) && ru.Value.Equals(scope)); Scopes.Remove(existingScope); return(IdentityServiceResult.Success); }