public function canAccess($module, $action=NULL): bool {

		// FIXME parse custom routes
		
		// reveal module/action type
		if (is_null($action) and FALSE !== strpos($module, '/')) {
			list($module,$action) = explode('/', $module);
		}
		
		// user module is for login and personal profile
		if ($this->admin or 'user'==$module) {
			return TRUE;
		}
		
		// acl is cached
		$acl = $this->getAcl();

		foreach ($acl as $rule) {
			if ($rule->module_name == $module and (!$rule->action or ($rule->action and $rule->action == $action))) {
				return TRUE;
			}
		}
		
		return FALSE;
		
	}
public function canAccess($module, $action=NULL): bool {

		// FIXME parse custom routes
		
		// reveal module/action type
		if (is_null($action) and FALSE !== strpos($module, '/')) {
			list($module,$action) = explode('/', $module);
		}
		
		// user module is for login and personal profile
		if ($this->admin or 'user'==$module) {
			return TRUE;
		}
		
		// acl is cached
		$acl = $this->getAcl();

		foreach ($acl as $rule) {
			if ($rule->module_name == $module and (!$rule->action or ($rule->action and $rule->action == $action))) {
				return TRUE;
			}
		}
		
		return FALSE;
		
	}
public function canAccess ( $ module , $ action = NULL ) : bool { // FIXME parse custom routes // reveal module/action type if ( is_null ( $ action ) and FALSE !== strpos ( $ module , '/' ) ) { list ( $ module , $ action ) = explode ( '/' , $ module ) ; } // user module is for login and personal profile if ( $ this -> admin or 'user' == $ module ) { return TRUE ; } // acl is cached $ acl = $ this -> getAcl ( ) ; foreach ( $ acl as $ rule ) { if ( $ rule -> module_name == $ module and ( ! $ rule -> action or ( $ rule -> action and $ rule -> action == $ action ) ) ) { return TRUE ; } } return FALSE ; }
Check if this user has access permission to a module and optionally to a specific action.
Admin can access everything. This method use cache variable to load once from db.

@param	string	Module name.
@param	string	Optional action name.

@return	bool	True if access is granted.
Check if this user has access permission to a module and optionally to a specific action . Admin can access everything . This method use cache variable to load once from db .