/** * Check current employee permission on a given module * @param string $action * @param string $name * @return bool True if allowed */ public function can($action, $name) { return \Module::getPermissionStatic(\Module::getModuleIdByName($name), $action); }
public function getAllModules() { return \Module::getModulesOnDisk(true, $this->addonsDataProvider->isAddonsAuthenticated(), (int) \Context::getContext()->employee->id); }
protected function instanciateLegacyModule() { require_once _PS_MODULE_DIR_ . DIRECTORY_SEPARATOR . $this->attributes->get('name') . DIRECTORY_SEPARATOR . $this->attributes->get('name') . '.php'; $this->instance = \Module::getInstanceByName($this->attributes->get('name')); }