# Class RestrictionDefinition OptimaJet.Workflow.Core.Model.RestrictionDefinition Represents an authorization restriction on a [TransitionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/TransitionDefinition/) that associates an [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) with a [RestrictionType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/). Namespace: [OptimaJet.Workflow.Core.Model](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/) ```csharp public class RestrictionDefinition ``` ## Properties `[JsonConverter(typeof(StringEnumConverter))] [JsonConverter(typeof(SystemStringEnumConverter))] public RestrictionType Type { get; set; }` Gets or sets the [RestrictionType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/) that determines how a match for [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) affects transition authorization. `public ActorDefinition Actor { get; set; }` Gets or sets the [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) whose [ActorDefinition.Rule](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) determines whether a workflow participant identity matches this restriction. ## Methods `public static RestrictionDefinition Create(string type, ActorDefinition actor)` Creates a [RestrictionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) that associates `actor` with the [RestrictionType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/) parsed from `type`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `type` | `String` | The text representation of a [RestrictionType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/) to parse case-insensitively. | | `actor` | `ActorDefinition` | The [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) to associate with the restriction. | ### Returns | Type | Description | | --- | --- | | `RestrictionDefinition` | A new [RestrictionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) whose [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) is `actor` and whose [RestrictionDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) is the parsed result. | ### Remarks If `type` cannot be parsed, [RestrictionType.Allow](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/) is used. `public static RestrictionDefinition Create(RestrictionType type, ActorDefinition actor)` Creates a [RestrictionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) that associates `actor` with `type`. ### Parameters | Name | Type | Description | | --- | --- | --- | | `type` | `RestrictionType` | The [RestrictionType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/) to apply. | | `actor` | `ActorDefinition` | The [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) to associate with the restriction. | ### Returns | Type | Description | | --- | --- | | `RestrictionDefinition` | A new [RestrictionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) whose [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) is `actor` and whose [RestrictionDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) is `type`. | `public RestrictionDefinition Clone()` Creates a copy of this restriction and clones its associated [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/), when present, by using [ActorDefinition.Clone()](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/). ### Returns | Type | Description | | --- | --- | | `RestrictionDefinition` | A new [RestrictionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) with the same [RestrictionDefinition.Type](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) and an independently cloned [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/), when one is assigned. | `public RestrictionDefinition Clone(List actorDefinitions)` Creates a copy of this restriction and rebinds its [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) reference to an [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) from a supplied collection. ### Parameters | Name | Type | Description | | --- | --- | --- | | `actorDefinitions` | `List` | The [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) instances to search for one whose actor name matches that of the current [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/). | ### Returns | Type | Description | | --- | --- | | `RestrictionDefinition` | A new [RestrictionDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) that references the matching [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) from `actorDefinitions` when an actor is assigned. | ### Exceptions | Type | Description | | --- | --- | | `ArgumentNullException` | The current [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) is assigned and `actorDefinitions` is [null](https://learn.microsoft.com/dotnet/csharp/language-reference/keywords/null). | | `InvalidOperationException` | The current [RestrictionDefinition.Actor](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionDefinition/) is assigned and `actorDefinitions` contains no [ActorDefinition](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ActorDefinition/) with the same actor name. | ### Remarks Actor names are compared by using [StringComparison.Ordinal](https://learn.microsoft.com/dotnet/api/system.stringcomparison#system-stringcomparison-ordinal). [Previous ProcessInstanceTenantGlobalParameterExtensions](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/ProcessInstanceTenantGlobalParameterExtensions/) [Next RestrictionType](https://api.workflowengine.io/core/OptimaJet.Workflow.Core.Model/RestrictionType/)