*/ class PermissionManager { const CONFIG_KEY = 'permissions'; /** * @return PermissionInterface * @deprecated */ public static function getPermissionModel() { try { return ServiceManager::getServiceManager()->get(PermissionInterface::SERVICE_ID); } catch (ServiceNotFoundException $e) { common_Logger::w('No permission implementation found'); return new NoAccess(); } } /** * @deprecated */ public static function setPermissionModel(PermissionInterface $model) { return ServiceManager::getServiceManager()->register(PermissionInterface::SERVICE_ID, $model); } public static function catchEvent(Event $event) { if ($event instanceof ResourceCreated) { self::getPermissionModel()->onResourceCreated($event->getResource()); } } }