Class yeesoft\models\Permission

Inheritanceyeesoft\models\Permission » yeesoft\models\AbstractItem » yeesoft\db\ActiveRecord » yii\db\ActiveRecord

Public Methods

Hide inherited methods

MethodDescriptionDefined By
addChildren() Helper for adding children to role or permission yeesoft\models\AbstractItem
afterDelete() Invalidate permissions if some item is deleted yeesoft\models\AbstractItem
assignRoutes() Assign route to permission and create them if they don't exists Helper mainly for migrations yeesoft\models\Permission
attributeLabels() yeesoft\models\AbstractItem
beforeSave() Ensure type of item yeesoft\models\AbstractItem
behaviors() yeesoft\models\AbstractItem
create() Useful helper for migrations and other stuff If description is null than it will be transformed like "editUserEmail" => "Edit user email" yeesoft\models\AbstractItem
deleteIfExists() yeesoft\models\AbstractItem
find() yeesoft\models\AbstractItem
getGroup() yeesoft\models\AbstractItem
getUserPermissions() yeesoft\models\Permission
isMultilingual() Returns TRUE if model support multilingual behavior. yeesoft\db\ActiveRecord
removeChildren() yeesoft\models\AbstractItem
rules() yeesoft\models\AbstractItem
tableName() yeesoft\models\AbstractItem
validateUniqueName() Default unique validator search only within specific class (Role, Route or Permission) because of the overwritten find() method yeesoft\models\AbstractItem

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
ITEM_TYPE self::TYPE_PERMISSION yeesoft\models\Permission
TYPE_PERMISSION 2 yeesoft\models\AbstractItem
TYPE_ROLE 1 yeesoft\models\AbstractItem
TYPE_ROUTE 3 yeesoft\models\AbstractItem

Method Details

assignRoutes() public static method

Assign route to permission and create them if they don't exists Helper mainly for migrations

public static true|static|string assignRoutes ( $permissionName, $routes, $permissionDescription null, $groupCode null )
$permissionName string
$routes array|string
$permissionDescription null|string
$groupCode null|string
throws InvalidArgumentException
getUserPermissions() public static method

public static array|\yii\rbac\Permission getUserPermissions ( $userId )
$userId int