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

```php
Component::make()
    ->setAuthorize('route.to.authorize')
```

---
`authorize` | `->setAuthorize()`

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

Because the roles system is based on the route check, you can create a "phantom" empty route under the `auth` middleware and then use it for permission check.

Can also handle an array:  
`->setAuthorize(['route_1','route_2'])`

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

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

Applies to any component (Form fields, Visuals, containers). When the roles system is disabled (`k-framework.roles.enabled=false`) the check is skipped and the component always renders. When enabled and omitted (`null`), no permission check runs and the component renders normally.
Pass a route name, an array of route names (all required), or a Closure returning a boolean for dynamic logic.

### Example
Blade:
```php
{!! \KFramework\Components\Visual\Button::make('Admin export')->setAuthorize('admin.export') !!}
```
Controller:
```php
Button::make('Admin export')->setAuthorize('admin.export');
Button::make('Multi check')->setAuthorize(['admin.export', 'admin.view']);
```

### Interaction / tips
- Pair with `authorizeRole` (../shared_attributes/authorizeRole.md): both must pass when both are set (`canPermissionRender()` checks each).
- Use for field-level hiding inside `schema` (../shared_attributes/schema.md) instead of wrapping whole forms.
- For ad-hoc gates without a real route, create a phantom route under `auth` middleware and reference it here.

See also: [authorizeRole](authorizeRole.md), [hidden](hidden.md), [schema](schema.md), [uuid](uuid.md), [basics](../basics.md), [Button](../visuals/button.md).