Class yeesoft\models\Route

Inheritanceyeesoft\models\Route » 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
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
getUserRoutes() Get all routes available for this user yeesoft\models\Route
isFreeAccess() Check if controller has $freeAccess = true or $action in $freeAccessActions Or it's login, logout, error page yeesoft\models\Route
isMultilingual() Returns TRUE if model support multilingual behavior. yeesoft\db\ActiveRecord
isRouteAllowed() Checks if route is in array of allowed routes yeesoft\models\Route
isSubRoute() Checks if "candidate" is sub-route of "route". For example: yeesoft\models\Route
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
withSubRoutes() Return given route with all they sub-routes yeesoft\models\Route

Protected Methods

Hide inherited methods

MethodDescriptionDefined By
isInCommonPermission() Check if current route allowed for everyone (in commonPermission routes) yeesoft\models\Route

Constants

Hide inherited constants

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

Method Details

getUserRoutes() public static method

Get all routes available for this user

public static array getUserRoutes ( $userId, $withSubRoutes true )
$userId int
$withSubRoutes bool
isFreeAccess() public static method

Check if controller has $freeAccess = true or $action in $freeAccessActions Or it's login, logout, error page

public static bool isFreeAccess ( $route, $action null )
$route string
$action \yii\base\Action|null
isInCommonPermission() protected static method

Check if current route allowed for everyone (in commonPermission routes)

protected static bool isInCommonPermission ( $currentFullRoute )
$currentFullRoute string
isRouteAllowed() public static method

Checks if route is in array of allowed routes

public static boolean isRouteAllowed ( $route, $allowedRoutes )
$route string
$allowedRoutes array
isSubRoute() public static method

Checks if "candidate" is sub-route of "route". For example:

"/module/controller/action" is sub-route of "/module/*"

public static bool isSubRoute ( $route, $candidate )
$route string
$candidate string
withSubRoutes() public static method

Return given route with all they sub-routes

public static array withSubRoutes ( $givenRoutes, $allRoutes )
$givenRoutes array
$allRoutes array