Skip to content

Commit

Permalink
Add a new restriction
Browse files Browse the repository at this point in the history
  • Loading branch information
pdavide committed Apr 17, 2021
1 parent 8c2355e commit 9cc2088
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion SuperUserOnlyRestrictions.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ public function registerEvents()
'Controller.UsersManager.userSettings' => 'restrictAccess',
'Controller.Widgetize.index' => 'restrictAccess',
'Controller.API.listAllAPI' => 'restrictAccess',
'Controller.CoreAdminHome.trackingCodeGenerator' => 'restrictAccess',
];
}

Expand All @@ -50,7 +51,8 @@ public function registerEvents()
*/
public function restrictAccess()
{
if(isset($this->pluginConfig['super_user_only_restrictions_enabled']) && $this->pluginConfig['super_user_only_restrictions_enabled']){
if(isset($this->pluginConfig['super_user_only_restrictions_enabled'])
&& $this->pluginConfig['super_user_only_restrictions_enabled']) {
Piwik::checkUserIsNotAnonymous();
Piwik::checkUserHasSuperUserAccess();
}
Expand Down

0 comments on commit 9cc2088

Please sign in to comment.