---
title: "Class RepositoryFileProtector | Customer's Canvas On-Premises"
canonical: "https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Storage.Repositories.Protectors/RepositoryFileProtector/"
---

# Class RepositoryFileProtector

> **Inheritance:** `System.Object` -> RepositoryFileProtector

###### **Namespace**: [Aurigma.DesignAtoms.Storage.Repositories.Protectors](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Storage.Repositories.Protectors.md)

###### **Assembly**: Aurigma.DesignAtoms.dll

```csharp title="Syntax"
public class RepositoryFileProtector : IRepositoryFileProtector
```

## Implements

* [Aurigma.DesignAtoms.Storage.Repositories.Interfaces.Protectors.IRepositoryFileProtector](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Storage.Repositories.Interfaces.Protectors/IRepositoryFileProtector.md)

## Inherited Members

* `System.Object.ToString`
* `System.Object.Equals(System.Object)`
* `System.Object.Equals(System.Object,System.Object)`
* `System.Object.ReferenceEquals(System.Object,System.Object)`
* `System.Object.GetHashCode`
* `System.Object.GetType`
* `System.Object.MemberwiseClone`

## Constructors

### RepositoryFileProtector

```csharp
public RepositoryFileProtector(IFileRepository fileRepository)
```

### RepositoryFileProtector

```csharp
public RepositoryFileProtector(IEnumerable<IRepositoryFileProtectionProvider> fileProtectionProviders, IFileRepository fileRepository)
```

## Methods

### IsProtected

```csharp
public bool IsProtected(StorageFileInfoModel storageFileInfoModel)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `Aurigma.DesignAtoms.Storages.Abstractions.Models.StorageFileInfoModel` | *storageFileInfoModel* |  |

##### Returns

`System.Boolean`

### IsProtectedAsync

```csharp
public Task<bool> IsProtectedAsync(StorageFileInfoModel storageFileInfoModel)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `Aurigma.DesignAtoms.Storages.Abstractions.Models.StorageFileInfoModel` | *storageFileInfoModel* |  |

##### Returns

`System.Threading.Tasks.Task<System.Boolean>`

### SetProtection

```csharp
public void SetProtection(StorageFileInfoModel storageFileInfoModel, bool isProtected)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `Aurigma.DesignAtoms.Storages.Abstractions.Models.StorageFileInfoModel` | *storageFileInfoModel* |  |
| `System.Boolean` | *isProtected* |  |

### SetProtectionAsync

```csharp
public Task SetProtectionAsync(StorageFileInfoModel storageFileInfoModel, bool isProtected)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| `Aurigma.DesignAtoms.Storages.Abstractions.Models.StorageFileInfoModel` | *storageFileInfoModel* |  |
| `System.Boolean` | *isProtected* |  |

##### Returns

`System.Threading.Tasks.Task`

### AddFileProtectionProvider

```csharp
public void AddFileProtectionProvider(IRepositoryFileProtectionProvider fileProtectionProvider)
```

##### Parameters

| Type | Name | Description |
|:---|:---|:---|
| [Aurigma.DesignAtoms.Storage.Repositories.Interfaces.Protectors.IRepositoryFileProtectionProvider](https://customerscanvas.com/docs/on-premises/design-atoms-cs/reference/api/Aurigma.DesignAtoms.Storage.Repositories.Interfaces.Protectors/IRepositoryFileProtectionProvider.md) | *fileProtectionProvider* |  |
