# OpcAccessControlRole Members

> Reference: Represents a single access control role OpcPrincipal instances can be a member of.

<dl class="api-definition">
<dt>Type</dt>
<dd><a href="./">OpcAccessControlRole</a></dd>
<dt>Namespace</dt>
<dd><a href="../namespaces/opc.uafx.server">Opc.UaFx.Server</a></dd>
<dt>Assembly</dt>
<dd>Opc.UaFx.Advanced.dll</dd>
<dt>Package</dt>
<dd>Opc.UaFx.Advanced v2.59.0</dd>
</dl>

## Constructors

### OpcAccessControlRole

Initializes a new instance of the [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/) class using the `identifier` and `name` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public OpcAccessControlRole(OpcNodeId identifier, string name)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub New(identifier As OpcNodeId, name As String)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `identifier` | [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) | The [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) which identifies the new [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/). |
| `name` | [String](https://learn.microsoft.com/dotnet/api/system.string) | The name of the new [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/). |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `identifier` or `name` is a null reference (Nothing in Visual Basic). |

## Properties

### Identifier

Gets the identifier of the current [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/).

<div class="api-signature" data-lang="csharp">

```csharp
public OpcNodeId Identifier { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Identifier As OpcNodeId
```

</div>

**Property value**

[OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/)

An instance of the [OpcNodeId](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.opcnodeid/) class.

### Name

Gets the name of the current [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/).

<div class="api-signature" data-lang="csharp">

```csharp
public string Name { get; }
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public ReadOnly Property Name As String
```

</div>

**Property value**

[String](https://learn.microsoft.com/dotnet/api/system.string)

A [string](https://learn.microsoft.com/dotnet/api/system.string) value.

## Methods

### Assign

Assigns the `principal` specified to the current [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/).

<div class="api-signature" data-lang="csharp">

```csharp
public void Assign(OpcPrincipal principal)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Assign(principal As OpcPrincipal)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `principal` | [OpcPrincipal](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcprincipal/) | An instance of the [OpcPrincipal](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcprincipal/) which is to be assigned to this role. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `principal` is a null reference (Nothing in Visual Basic). |

### Contains

Determines whether the `principal` is a member of the current [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/).

<div class="api-signature" data-lang="csharp">

```csharp
public bool Contains(OpcPrincipal principal)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Function Contains(principal As OpcPrincipal) As Boolean
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `principal` | [OpcPrincipal](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcprincipal/) | An instance of the [OpcPrincipal](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcprincipal/) which its membership is to be verified. |

**Returns**

[Boolean](https://learn.microsoft.com/dotnet/api/system.boolean)

The value true if the `principal` is a member of the current [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/); otherwise the value false.

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `principal` is a null reference (Nothing in Visual Basic). |

### Revoke

Revokes the assignment of the current [OpcAccessControlRole](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcaccesscontrolrole/) to the `principal` specified.

<div class="api-signature" data-lang="csharp">

```csharp
public void Revoke(OpcPrincipal principal)
```

</div>

<div class="api-signature" data-lang="vbnet">

```vbnet
Public Sub Revoke(principal As OpcPrincipal)
```

</div>

**Parameters**

| Name | Type | Description |
|---|---|---|
| `principal` | [OpcPrincipal](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcprincipal/) | An instance of the [OpcPrincipal](https://www.traeger.de/en/docs/development/opcua/api/v2.59/opc.uafx.server.opcprincipal/) its assignment is to be revoked. |

**Exceptions**

| Exception | Condition |
|---|---|
| [ArgumentNullException](https://learn.microsoft.com/dotnet/api/system.argumentnullexception) | The `principal` is a null reference (Nothing in Visual Basic). |
