scholarslab / SolrSearch

Add a Solr-backed search interface to Omeka.
http://omeka.org/codex/Plugins/SolrSearch
Apache License 2.0
22 stars 28 forks source link

researcher profile has access to change solr settings (!) #136

Open AmandaUCSC opened 7 years ago

AmandaUCSC commented 7 years ago

Hi, I posted about this on the main Omeka forum and Patrick suggested I post here instead. When I create a researcher profile the Solr plug-in is the only plug-in that still allows this profile to make changes to any settings, including "Clear and Reindex." I need to change this as a "researcher" shouldn't have any access to change these settings. Patrick suggested changing/adding the define_acl hook, but when I add it to:

protected $_hooks = array( 'install', 'uninstall', 'upgrade', 'initialize', 'define_routes', 'after_save_record', 'after_save_item', 'after_save_element', 'before_delete_record', 'before_delete_item', 'before_delete_element' );

I get a list of errors with the message that: Exception 'Omeka_Plugin_Exception' with message 'Hook callback "hookDefineAcl" does not exist.' in [domain]/omeka/application/libraries/Omeka/Plugin/AbstractPlugin.php:162

According to patrick, "After adding that to the list of hooks, Omeka will expect there to be a function called hookDefineAcl that does the actual job of setting up the permissions. Without knowing the inner workings of the plugin, it's hard to guess exactly what should go in there."

I'm not sure what to change at this point. Any ideas?

kloor commented 7 years ago

I submitted a pull request that was merged to the develop branch to fix this issue: https://github.com/scholarslab/SolrSearch/pull/126

I do not know why the project has not packaged a new release with this change. I would recommend downloading a copy of the develop branch to use as the plugin from: https://github.com/scholarslab/SolrSearch/archive/develop.zip