# ClusterRole Properties

- Package: [Aspire.Hosting.Kubernetes](/reference/api/csharp/aspire.hosting.kubernetes.md)
- Type: [ClusterRole](/reference/api/csharp/aspire.hosting.kubernetes/clusterrole.md)
- Kind: `Properties`
- Members: `2`

Represents a Kubernetes ClusterRole resource in API version v1.

## AggregationRule

- Name: `AggregationRule`
- Modifiers: `nullable` `get; set`
- Returns: [AggregationRuleV1?](/reference/api/csharp/aspire.hosting.kubernetes/aggregationrulev1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ClusterRoleV1.cs)

Gets or sets the aggregation rule associated with the ClusterRole. Defines how multiple cluster roles can be aggregated together, simplifying role-based access control implementation.

```csharp
public AggregationRuleV1? AggregationRule { get; set; }
```

## Remarks

The AggregationRule allows for automatic composition of permissions by defining a set of label selectors that identify the roles to be aggregated. Use this property to configure advanced RBAC mechanisms in Kubernetes clusters.

## Rules

- Name: `Rules`
- Modifiers: `get`
- Returns: [List<PolicyRuleV1>](/reference/api/csharp/aspire.hosting.kubernetes/policyrulev1.md)
- Source: [GitHub](https://github.com/microsoft/aspire/blob/5bd693ae1897dee5e2ce71c2cc08879c1c7eff51/src/Aspire.Hosting.Kubernetes/Resources/ClusterRoleV1.cs#L42)

Represents a collection of policy rules applied to the Kubernetes ClusterRole.

```csharp
public List<PolicyRuleV1> Rules { get; }
```

## Remarks

The `Rules` property defines a set of rules that dictate access permissions within a Kubernetes ClusterRole resource. Each rule describes the actions, resources, and namespaces that are subject to specific policies. This property is a list of `PolicyRuleV1` objects, where each object specifies the precise components of a policy rule, including API groups, resources, verbs, and URLs.
