/** * {@inheritDoc} * @see IPluggableAccessModule::unregisterAuthHierarchyFromModule() */ public function unregisterAuthHierarchyFromModule(IPluggableModule $module) { $authmgr = $this->getAccessManager(); foreach ($module->getAccessRoles() as $role) { $authmgr->removeAuthItem($module, $role); } }
/** * {@inheritDoc} * @see IPluggableAccessManager::clearAuthAssignments() */ public function clearAuthAssignments(IPluggableModule $module) { $criteria = new CDbCriteria(); $criteria->with = array('accessRole' => array('alias' => 'r')); $criteria->compare('r.module_name', $module->getId()); return AccessAssignment::model()->deleteAll($criteria); }
/** * {@inheritDoc} * @see IPluggableWebApplication::getRuntimeDirectory() */ public function getRuntimeDirectory(IPluggableModule $module) { $modulepath = explode('/', $module->getId()); $path = $this->getRuntimePath(); foreach ($modulepath as $part) { if (!is_dir($path . DIRECTORY_SEPARATOR . $part)) { mkdir($path . DIRECTORY_SEPARATOR . $part); } $path .= DIRECTORY_SEPARATOR . $part; } return $path; }
/** * {@inheritDoc} * @see IPluggableAccessManager::hasItemChild() */ public function hasItemChild(IPluggableModule $module, IPluggableAccessHierarchy $hierarchy) { return $this->_manager->hasItemChild($module->getId() . '::' . $hierarchy->getHigherLevelName(), $module->getId() . '::' . $hierarchy->getLowerLevelName()); }