# [Usage](../../../usage.md) > [Components and standard attributes](../basics.md) > authorizeRole

```php
Component::make()
    ->setAuthorizeRole('Role name')
```

---
`authorizeRole` | `->setAuthorizeRole()`

Can be used on any K-Framework component, it receives a role name. If roles system is enabled, it will check if user has assigned that role, if not, it will not render the component.

Can also handle an array:  
```php
->setAuthorizeRole(['First role name', 'Second role name'])
```

In the case of the array, the component is available only if all of the roles are added for the user.

| Types                        | Default |
|------------------------------|---------|
| `Closure`, `string`, `array` | `null`  |

Works on any component (Form fields, Visuals, containers). When the roles system is disabled the check is skipped; when omitted (`null`) the component renders without a role check. Accepts a single role name, an array of role names (all required), or a Closure for custom logic.
Prefer this over `authorize` when your rule is role-based rather than route-permission-based.

### Example
Blade:
```php
{!! \KFramework\Components\Visual\Button::make('Manager approve')->setAuthorizeRole('manager') !!}
```
Controller:
```php
Button::make('Manager approve')->setAuthorizeRole('manager');
Input::make('salary')->setAuthorizeRole(['admin', 'hr']);
```

### Interaction / tips
- Combine with `authorize` (../shared_attributes/authorize.md) for route + role gating; both must pass.
- Use inside `schema` (../shared_attributes/schema.md) to hide single fields for certain roles.
- Prefer `hidden` (../shared_attributes/hidden.md) for non-security UI toggling; `authorizeRole` is a render gate.

See also: [authorize](authorize.md), [hidden](hidden.md), [schema](schema.md), [uuid](uuid.md), [basics](../basics.md), [Form](../forms/form.md).