Class yeesoft\helpers\AuthHelper

Inheritanceyeesoft\helpers\AuthHelper

Public Methods

Hide inherited methods

MethodDescriptionDefined By
ensurePermissionsUpToDate() Checks if permissions has been changed somehow, and refresh data in session if necessary yeesoft\helpers\AuthHelper
getAllModules() yeesoft\helpers\AuthHelper
getChildrenByType() Get child routes, permissions or roles yeesoft\helpers\AuthHelper
getPermissionsLastModFile() Get path to file that store time of the last auth changes yeesoft\helpers\AuthHelper
invalidatePermissions() Change modification time of permissions last mod file yeesoft\helpers\AuthHelper
separateRoutesAndPermissions() Select items that has "/" in permissions yeesoft\helpers\AuthHelper
unifyRoute() Return route without baseUrl and start it with slash yeesoft\helpers\AuthHelper
updatePermissions() Gather all user permissions and roles and store them in the session yeesoft\helpers\AuthHelper

Constants

Hide inherited constants

ConstantValueDescriptionDefined By
SESSION_PREFIX_LAST_UPDATE '__auth_last_update' yeesoft\helpers\AuthHelper
SESSION_PREFIX_PERMISSIONS '__userPermissions' yeesoft\helpers\AuthHelper
SESSION_PREFIX_ROLES '__userRoles' yeesoft\helpers\AuthHelper
SESSION_PREFIX_ROUTES '__userRoutes' yeesoft\helpers\AuthHelper

Method Details

ensurePermissionsUpToDate() public static method

Checks if permissions has been changed somehow, and refresh data in session if necessary

public static void ensurePermissionsUpToDate ( )
getAllModules() public static method

public static array getAllModules ( )
getChildrenByType() public static method

Get child routes, permissions or roles

public static array getChildrenByType ( $itemName, $childType )
$itemName string
$childType integer
getPermissionsLastModFile() public static method

Get path to file that store time of the last auth changes

public static string getPermissionsLastModFile ( )
invalidatePermissions() public static method

Change modification time of permissions last mod file

public static void invalidatePermissions ( )
separateRoutesAndPermissions() public static method

Select items that has "/" in permissions

public static object separateRoutesAndPermissions ( $allPermissions )
$allPermissions array
unifyRoute() public static method

Return route without baseUrl and start it with slash

public static string unifyRoute ( $route )
$route string|array
updatePermissions() public static method

Gather all user permissions and roles and store them in the session

public static void updatePermissions ( $identity )
$identity \yeesoft\helpers\UserIdentity