# Permission

> For more details and usage information on Permission, see the [guide article on security authorization](https://yii2-framework.github.io/docs/guide/security-authorization/).

[API reference](/docs/api/index.md) › [yii](/docs/api/yii/index.md) › [rbac](/docs/api/yii/rbac/index.md) › Permission

| class | `yii\rbac\Permission` |
| --- | --- |
| Extends | [`Item`](/docs/api/yii/rbac/item/index.md) » [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| Implements | [`yii\base\Configurable`](/docs/api/yii/base/configurable/index.md) |
| Since | 2.0 |
| Source | [`framework/rbac/Permission.php`](https://github.com/yiisoft/yii2/blob/22.0/framework/rbac/Permission.php#L17) |

For more details and usage information on Permission, see the [guide article on security authorization](/docs/guide/security-authorization/index.md).

## Properties

| Property | Type | Description | Defined by |
| --- | --- | --- | --- |
| <span id="property-createdAt"></span>[`$createdAt`](/docs/api/yii/rbac/item/index.md#property-createdAt) | `int` | UNIX timestamp representing the item creation time Default: `null`. | [`Item`](/docs/api/yii/rbac/item/index.md) |
| <span id="property-data"></span>[`$data`](/docs/api/yii/rbac/item/index.md#property-data) | `mixed` | The additional data associated with this item Default: `null`. | [`Item`](/docs/api/yii/rbac/item/index.md) |
| <span id="property-description"></span>[`$description`](/docs/api/yii/rbac/item/index.md#property-description) | `string` | The item description Default: `null`. | [`Item`](/docs/api/yii/rbac/item/index.md) |
| <span id="property-name"></span>[`$name`](/docs/api/yii/rbac/item/index.md#property-name) | `string` | The name of the item. Default: `null`. | [`Item`](/docs/api/yii/rbac/item/index.md) |
| <span id="property-ruleName"></span>[`$ruleName`](/docs/api/yii/rbac/item/index.md#property-ruleName) | `string\|null` | Name of the rule associated with this item Default: `null`. | [`Item`](/docs/api/yii/rbac/item/index.md) |
| [`$type`](#property-type) | `int` | Default: `self::TYPE_PERMISSION`. | `Permission` |
| <span id="property-updatedAt"></span>[`$updatedAt`](/docs/api/yii/rbac/item/index.md#property-updatedAt) | `int` | UNIX timestamp representing the item updating time Default: `null`. | [`Item`](/docs/api/yii/rbac/item/index.md) |

## Methods

| Method | Description | Defined by |
| --- | --- | --- |
| <span id="method-__construct"></span>[`__construct()`](/docs/api/yii/base/baseobject/index.md#method-__construct) | Constructor. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__call"></span>[`__call()`](/docs/api/yii/base/baseobject/index.md#method-__call) | Calls the named method which is not a class method. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__get"></span>[`__get()`](/docs/api/yii/base/baseobject/index.md#method-__get) | Returns the value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__isset"></span>[`__isset()`](/docs/api/yii/base/baseobject/index.md#method-__isset) | Checks if a property is set, i.e. defined and not null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__set"></span>[`__set()`](/docs/api/yii/base/baseobject/index.md#method-__set) | Sets value of an object property. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-__unset"></span>[`__unset()`](/docs/api/yii/base/baseobject/index.md#method-__unset) | Sets an object property to null. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canGetProperty"></span>[`canGetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canGetProperty) | Returns a value indicating whether a property can be read. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-canSetProperty"></span>[`canSetProperty()`](/docs/api/yii/base/baseobject/index.md#method-canSetProperty) | Returns a value indicating whether a property can be set. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-className"></span>[`className()`](/docs/api/yii/base/baseobject/index.md#method-className) static | Returns the fully qualified name of this class. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-hasMethod"></span>[`hasMethod()`](/docs/api/yii/base/baseobject/index.md#method-hasMethod) | Returns a value indicating whether a method is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-hasProperty"></span>[`hasProperty()`](/docs/api/yii/base/baseobject/index.md#method-hasProperty) | Returns a value indicating whether a property is defined. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |
| <span id="method-init"></span>[`init()`](/docs/api/yii/base/baseobject/index.md#method-init) | Initializes the object. | [`yii\base\BaseObject`](/docs/api/yii/base/baseobject/index.md) |

## Constants

| Constant | Value | Description | Defined by |
| --- | --- | --- | --- |
| <span id="const-TYPE_ROLE"></span>[`TYPE_ROLE`](/docs/api/yii/rbac/item/index.md#const-TYPE_ROLE) | `1` |  | [`Item`](/docs/api/yii/rbac/item/index.md) |
| <span id="const-TYPE_PERMISSION"></span>[`TYPE_PERMISSION`](/docs/api/yii/rbac/item/index.md#const-TYPE_PERMISSION) | `2` |  | [`Item`](/docs/api/yii/rbac/item/index.md) |

## Property details

### $type <span id="property-type"></span>

```php
public int $type = self::TYPE_PERMISSION
```

This should be either [`TYPE_ROLE`](/docs/api/yii/rbac/item/index.md#const-TYPE_ROLE) or [`TYPE_PERMISSION`](/docs/api/yii/rbac/item/index.md#const-TYPE_PERMISSION).