Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions API.php
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,14 @@ protected function checkUserHasWriteAccess($idSite = null)
{
if ($idSite != false) {
Piwik::checkUserHasWriteAccess($idSite);
return;
}
$settings = $this->getPluginSettings();
$externalShortcodesIdSite = $settings->getSetting(ShortcodeTracker::SHORTENER_EXTERNAL_SHORTCODES_IDSITE)->getValue();
if ($externalShortcodesIdSite !== null)
{
Piwik::checkUserHasWriteAccess($externalShortcodesIdSite);
return;
}
Piwik::checkUserHasSuperUserAccess();
}
Expand Down
2 changes: 1 addition & 1 deletion Widgets/GetShortcodegenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public static function configure(WidgetConfig $config)
* $config->setParameters(array('myparam' => 'myvalue'));
*/

if (Piwik::isUserHasSomeAdminAccess() === false) {
if (Piwik::isUserHasSomeWriteAccess() === false) {
$config->disable();
}
/**
Expand Down
2 changes: 2 additions & 0 deletions changelog.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
## Changelog
* 1.2.1
* Allow any user with Write permission to generate shortcodes (previously it would require SuperAdmin access)
* 1.2.0
* add proper LICENSE file to codebase

Expand Down
2 changes: 1 addition & 1 deletion plugin.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ShortcodeTracker",
"version": "1.2.0",
"version": "1.2.1",
"description": "Plugin allowing user to create shortcodes and track their usage within Piwik. Also integrates with UI to deliver user-friendly interaction.",
"theme": false,
"keywords": [
Expand Down