I get this error while uploading files on Supabase storage, again supabase storage not table :
new row violates row-level security policy
This is the code I am using in .NET :
internal sealed class StorageRepository : IStorageRepository
{
private readonly Client _client;
public StorageRepository(Client client)
{
_client = client;
}
public async Task<string> SaveFileAsync(
byte[] file,
string identifier,
string bucketName)
{
var result = await _client
.Storage
.From(bucketName)
.Upload(
data: file,
supabasePath: identifier);
return result;
}
}
This is complete error with detailed exception :
new row violates row-level security policy at Supabase.Storage.Extensions.HttpClientProgress.UploadAsync(HttpClient client, Uri uri, Stream stream, Dictionary`2 headers, Progress`1 progress) at Supabase.Storage.StorageFileApi.UploadOrUpdate(Byte[] data
I have tried by adding a new policy which allows only authenticated user to { SELECT, UPDATE, DELETE, UPDATE } but still it did not work: