impress-org / google-maps-builder

One Google Maps plugin to rule them all. Google Maps Builder is intuitive, sleek, powerful and easy to use. Forget the rest, use the best.
https://wordpress.org/plugins/google-maps-builder/
32 stars 9 forks source link

feat(csv-import): Add a filter to change the user capabilities to allow to import markers #272

Open kevinwhoffman opened 6 years ago

kevinwhoffman commented 6 years ago

@marutim commented on Fri May 25 2018

User Story

As a user, I want the flexibility in the user roles/capabilities that can import a csv for markers.

Now the user capabilities is set to if ( ! current_user_can( 'install_plugins' ) ) which creates an issue for a setup where the admin has disabled this by adding the below to the config file.

define( 'DISALLOW_FILE_MODS', true ); define( 'DISALLOW_FILE_EDIT', true );

This will block users being able to use the plugin and theme installation/update functionality from the WordPress admin area.

Possible Solution

Add a fllter to the following lines to let the admin change the user capabilities to something like create_users to make this work. https://github.com/WordImpress/Maps-Builder-Pro/blob/master/includes/admin/import-export/class-marker-importer.php#L251 https://github.com/WordImpress/Maps-Builder-Pro/blob/master/includes/admin/import-export/class-marker-importer.php#L336

Related

This was reported by a user here: https://secure.helpscout.net/conversation/563906640/17105/?folderId=672191