---
title: "Class Rule"
slug: "sdk--stylelabs.m.sdk.models.policies.rule"
abstract: ""
---
# Class Rule

Describes a rule.

## Inheritance

object

Rule

## Implements

[IRule](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.policies.irule.html)

## Namespace: StylelabsStylelabs.MSdkStylelabs.M.Sdk.ModelsPolicies

## Assembly: Stylelabs.M.Sdk.dll

## Syntax

```csharp
public class Rule : IRule
```

## Properties

### Conditions

Gets non null collection of conditions which needs to be fulfilled uniformly in order to trigger this rule (i.e. conditions are combined with "AND" logical operator).

#### Declaration

```csharp
public IList<ICondition> Conditions { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| IList<>[ICondition](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.policies.icondition.html) |  |

### CreatedByLoggedOnUser

Gets or sets a value indicating whether if set to true, this rule only applies to entities created by the logged on user.

#### Declaration

```csharp
public bool CreatedByLoggedOnUser { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| bool |  |

### DefinitionNames

Gets non null collection entity definition resource links which define the entity definitions to which this policy applies.

#### Declaration

```csharp
public IList<string> DefinitionNames { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| IList<>string |  |

### Identifier

Gets unique identifier of the rule, usually GUID string. This identifier is automatically generated by the system.

#### Declaration

```csharp
public Guid? Identifier { get; }
```

#### Property Value

| Type | Description |
| --- | --- |
| Guid |  |

### IsSystemOwned

Gets or sets a value indicating whether indicates if this object is owned by the system and cannot be updated by users.

#### Declaration

```csharp
public bool IsSystemOwned { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| bool |  |

### Permissions

Gets non null collection of permissions this rule grands, the permissions are simple string constants recognized by the system.

#### Declaration

```csharp
public IList<string> Permissions { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| IList<>string |  |

### Type

Gets or sets the type of the rule. Indicates if this object is owned by the system and cannot be updated by users.

#### Declaration

```csharp
public RuleType Type { get; set; }
```

#### Property Value

| Type | Description |
| --- | --- |
| [RuleType](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.policies.ruletype.html) |  |

## Methods

### SetIdentifier(Guid?)

Sets the identifier.

#### Declaration

```csharp
public void SetIdentifier(Guid? guid)
```

#### Parameters

| Type | Name | Description |
| --- | --- | --- |
| Guid | guid | The identifier. |

### Implements

[IRule](https://doc.sitecore.com/ch/en/developers/api-reference/sdk--stylelabs.m.sdk.contracts.policies.irule.html)
