# SEL_PermissionSet

**Class** · Group: `Selectors`

Learn it: [Fast Start - Selectors](/fast-start-selectors) and [Selectors guide](/selectors-guide)

<div class="apex-member apex-class">

```apex
global inherited sharing class SEL_PermissionSet extends SEL_Base
```

**Extends:** [SEL_Base](/reference/apex/sel-base)

Selector for the PermissionSet SObject. Provides default field configuration and query methods for PermissionSet records, including namespace-aware lookup.

**Example**

```apex
PermissionSet adminSet = new SEL_PermissionSet().findByName('Administrator');
PermissionSet permissionSet = (PermissionSet)new SEL_PermissionSet().findById(permissionSetId);
```

**See Also:** [SEL_Base](/reference/apex/sel-base)

</div>

---

## Methods

| Method | Description |
|--------|-------------|
| global [PermissionSet](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_permissionset.htm) [findByName](#findbyname)([String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm) name) | Retrieves a PermissionSet record by name, searching both subscriber org (NamespacePrefix = null) and managed package namespace. |
| global override [List](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_list.htm)<[SObjectField](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_SObjectField.htm)> [getFields](#getfields)() | Returns the core fields for PermissionSet queries. |

### findByName

<div class="apex-member">

```apex
global PermissionSet findByName(String name)
```

Retrieves a PermissionSet record by name, searching both subscriber org (NamespacePrefix = null)
and managed package namespace. Subscriber org version takes precedence.

**Parameters**

| Parameter | Type | Description |
|-----------|------|-------------|
| `name` | [String](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_methods_system_string.htm) | The API name of the PermissionSet to retrieve (without namespace prefix) |

**Returns** [PermissionSet](https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_permissionset.htm) — The matching PermissionSet, or null if not found

**Example**

```apex
PermissionSet result = new SEL_PermissionSet().findByName('ReadOnly');
```

</div>

### getFields

<div class="apex-member">

```apex
global override List<SObjectField> getFields()
```

Returns the core fields for PermissionSet queries.

**Returns** [SObjectField](https://developer.salesforce.com/docs/atlas.en-us.apexref.meta/apexref/apex_class_Schema_SObjectField.htm) — List of PermissionSet SObjectField tokens

**Example**

```apex
List<SObjectField> result = instance.getFields();
```

</div>

## Constructors

| Constructor | Description |
|-------------|-------------|
| global [SEL_PermissionSet](#constructors)() | Constructs a PermissionSet selector with the PermissionSet SObjectType. |

### SEL_PermissionSet()

<div class="apex-member">

```apex
global SEL_PermissionSet()
```

Constructs a PermissionSet selector with the PermissionSet SObjectType.

**Example**

```apex
SEL_PermissionSet instance = new SEL_PermissionSet();
```

</div>
