/// <summary> /// Tries to get the <paramref name="permission"/> for the <paramref name="operation"/>. /// </summary> /// <param name="operation">The <see cref="ProtectedOperation"/>.</param> /// <param name="permission">The <see cref="Permission"/>.</param> /// <returns>Returns true when a <paramref name="permission"/> was found for the <paramref name="operation"/>, otherwise false.</returns> public bool TryGet(ProtectedOperation operation, out Permission permission) { // validate arguments if (operation == null) throw new ArgumentNullException("operation"); return permissions.TryGetValue(operation, out permission); }
public ValueTask <bool> CheckAuthorizationAsync(ProtectedOperation operation, CancellationToken cancellationToken = default) { return(new ValueTask <bool>(this.Allow)); }
public ValueTask <bool> CheckAuthorizationAsync( ProtectedOperation operation, CancellationToken cancellationToken = default) { throw new NotImplementedException(); }
public ValueTask <bool> CheckAuthorizationAsync(ProtectedOperation operation, CancellationToken cancellationToken = default) => new ValueTask <bool>(true);