Remove plugin permissions
509405
private function removePermissions()
    {
        $this->pluginsService->removePluginPermissions($this->pluginsService->collectPermissions($this->translator->trans('plugin.ingest.permissions.label')));
    }
839953
def _plugins_to_export(self):
        """"""
        ret = self.exportable_plugins
        for p in ret:
            if getattr(self.args, 'disable_' + p):
                ret.remove(p)
        return ret
726732
def closing_plugin(self, cancelable=False):
        """"""
        self.findinfiles.closing_widget()  # stop search thread and clean-up
        options = self.findinfiles.find_options.get_options(to_save=True)
        if options is not None:
            (search_text, text_re,
             exclude, exclude_idx, exclude_re,
             more_options, case_sensitive,
             path_history) = options
            hist_limit = 15
            search_text = search_text[:hist_limit]
            exclude = exclude[:hist_limit]
            path_history = path_history[-hist_limit:]
            self.set_option('search_text', search_text)
            self.set_option('search_text_regexp', text_re)
            self.set_option('exclude', exclude)
            self.set_option('exclude_idx', exclude_idx)
            self.set_option('exclude_regexp', exclude_re)
            self.set_option('more_options', more_options)
            self.set_option('case_sensitive', case_sensitive)
            self.set_option('path_history', path_history)
        return True
1278243
def release_plugin(self, name):
        
        plugin = self._active_plugins[name]
        if id(plugin) in self._provided_by_preset:
            self._provided_by_preset.remove(id(plugin))

        del self._active_plugins[name]
        delattr(self, name)
1039423
function handlePermissionStrategy (config) {
  const permissionStrategies = {
    config: require('../permission/config-permission-handler'), // eslint-disable-line
    none: require('../permission/open-permission-handler') // eslint-disable-line
  }

  if (!config.permission) {
    throw new Error('No permission type specified')
  }

  if (commandLineArguments.disablePermissions) {
    config.permission.type = 'none'
    config.permission.options = {}
  }

  if (config.permission.name || config.permission.path) {
    const PermHandler = resolvePluginClass(config.permission, 'permission')
    if (!PermHandler) {
      throw new Error(`unable to resolve plugin ${config.permission.name || config.permission.path}`)
    }
    config.permissionHandler = new PermHandler(config.permission.options, config.logger)
    return
  }

  if (!permissionStrategies[config.permission.type]) {
    throw new Error(`Unknown permission type ${config.permission.type}`)
  }

  if (config.permission.options && config.permission.options.path) {
    config.permission.options.path = fileUtils.lookupConfRequirePath(config.permission.options.path)
  }

  config.permissionHandler = new (permissionStrategies[config.permission.type])(config)
}
1095278
private function removePlugins($plugins)
    {
        foreach ($plugins as $pluginToBeRemoved) {
            $this
                ->pluginObjectManager
                ->remove($pluginToBeRemoved);

            $this
                ->pluginObjectManager
                ->flush($pluginToBeRemoved);
        }

        return $this;
    }
165630
def disable_plugin(self, name):
        
        url = self._url('/plugins/{0}/disable', name)
        res = self._post(url)
        self._raise_for_status(res)
        return True
711324
def disable_plugin(plugin_name):
    '''
    
    '''
    if isinstance(plugin_name, types.StringTypes):
        plugin_name = [plugin_name]

    # Verify all specified plugins are currently enabled.
    enabled_path = MICRODROP_CONDA_PLUGINS.joinpath('enabled')
    for name_i in plugin_name:
        plugin_path_i = enabled_path.joinpath(name_i)
        if not _islinklike(plugin_path_i) and not plugin_path_i.isdir():
            raise IOError('Plugin `{}` not found in `{}`'
                          .format(name_i, enabled_path))

    # All specified plugins are enabled.

    # Remove all specified plugins from
    # `<conda prefix>/etc/microdrop/plugins/enabled/`.
    for name_i in plugin_name:
        plugin_link_path_i = enabled_path.joinpath(name_i)
        plugin_link_path_i.unlink()
        logger.debug('Disabled plugin `%s` (i.e., removed `%s`)',
                     plugin_path_i, plugin_link_path_i)
1066484
def disable(self):
        

        self.client.api.disable_plugin(self.name)
        self.reload()
7652
public function disablePlugins($plugin)
    {
        $plugins = func_get_args();
        if (is_array(current($plugins))) {
            $plugins = current($plugins);
        }
        foreach ($plugins as $name) {
            unset($this->plugins[$name]);
        }
        return $this;
    }
1147915
public function removePageSessionPluginAction()
    {
        $module = $this->getRequest()->getQuery('module', null);
        $pluginName = $this->getRequest()->getQuery('pluginName', '');
        $pageId = $this->getRequest()->getQuery('pageId', null);
        $pluginId = $this->getRequest()->getQuery('pluginId', null);
        $pluginTag = $this->getRequest()->getQuery('pluginTag', null);
        
        $parameters = array(
            'module' => $module,
            'pluginName' => $pluginName,
            'pageId' => $pageId,
            'pluginId' => $pluginId,
            'pluginTag' => $pluginTag,
        );
        
        $translator = $this->serviceLocator->get('translator');

        if (empty($module) || empty($pluginName) || empty($pageId) || empty($pluginId))
        {

            $result = array(
                'success' => 0,
                'errors' => array(array('empty' => $translator->translate('tr_meliscms_form_common_errors_Empty datas')))
            );
        }
        else
        {

            $this->getEventManager()->trigger('meliscms_page_removesession_plugin_start', null, $parameters);
            
            // removing plugin from session
            $container = new Container('meliscms');
            if (!empty($container['content-pages'][$pageId][$pluginTag][$pluginId]))
                unset($container['content-pages'][$pageId][$pluginTag][$pluginId]);
            
            $this->getEventManager()->trigger('meliscms_page_removesession_plugin_end', null, $parameters);
            
            $result = array(
                'success' => 1,
                'errors' => array()
            );
        }
         
        return new JsonModel($result);
    }
139318
def revoke_permissions(self, ctype):
        
        ContentType = apps.get_model('contenttypes', 'ContentType')
        try:
            Permission = apps.get_model('auth', 'Permission')
        except LookupError:
            return

        codenames = ['{0}_{1}'.format(perm, ctype) for perm in self.default_permissions]
        cascade_element = apps.get_model(self.label, 'cascadeelement')
        element_ctype = ContentType.objects.get_for_model(cascade_element)
        Permission.objects.filter(content_type=element_ctype, codename__in=codenames).delete()
860142
def close_plugins(self, channel):
        """"""
        opmon = channel.opmon
        for key in opmon.get_active():
            obj = opmon.get_plugin(key)
            try:
                self.gui_call(obj.close)

            except Exception as e:
                self.logger.error(
                    "Failed to continue operation: %s" % (str(e)))
934830
def remove_plugin_filepaths(self, filepaths):
        
        filepaths = util.to_absolute_paths(filepaths)
        self.plugin_filepaths = util.remove_from_set(self.plugin_filepaths,
                                                     filepaths)
755202
function() {
                var index = -1;

                for (var i = 0; i < _srcElements.length; i++) {
                    if (_srcElements[i] === this.$element) {
                        index = i;
                        break;
                    }
                }

                _srcElements.splice(index, 1);


                this.hide();
                this.$element.data('plugin_' + pluginName, null);
                if (this.getTrigger() === 'click') {
                    this.$element.off('click');
                } else if (this.getTrigger() === 'hover') {
                    this.$element.off('mouseenter mouseleave');
                }
                if (this.$target) {
                    this.$target.remove();
                }
            }
257665
def remove_readonly(func, path, _):
    ""
    os.chmod(path, stat.S_IWRITE)
    func(path)
348276
@Override
    @PreAuthorize("hasRole(@configHolder.getSuperAdminRoleName()) or hasPermission(#plugin, 'DELETE')")
    public void delete(E plugin) {
        if (applicationService == null) {
            LOG.error("Plugin cannot be deleted, failed to autowire application service");
            return;
        }

        List<Application> apps = applicationService.findAllWithCollectionContaining("plugins", plugin);
        Integer pluginId = plugin.getId();
        for (Application app : apps) {
            List<Plugin> plugins = app.getPlugins();
            if (plugins != null && plugins.contains(plugin)) {
                String msg = String.format(
                    "Remove plugin (id=%s) from application (id=%s)",
                    pluginId, app.getId()
                );
                LOG.debug(msg);
                plugins.remove(plugin);
                // TODO will this use the the PreAuthorize annotations of AbstractCrudService wrt WRITE on the app?
                applicationService.saveOrUpdate(app);
            }
        }
        LOG.debug(String.format("Delete plugin (id=%s)", pluginId));
        // call overridden parent to actually delete the entity itself
        super.delete(plugin);
    }