@mattab opened this Issue on August 7th 2014 Owner

Reproduce:

  • create user
  • assign user to website 1
  • user creates a scheduled report for website 1
  • super user removes user access to website 1
  • run core:archive

It would result in following error (here for idreport=20): ScheduledReportsAPI.sendReport_20,ERROR: U kunt deze bron niet verwijderen omdat 'view' toegang is vereist

Goal of this ticket is to make scheduled task work, even though reports don't have necessary permissions.

More info: there are two solutions to this:

  • when user loses access to a website, we could delete the reports for this user and website,
  • or we could skip trying to send reports when a user does not have permission.

I think skipping reports is better solution, because in case the Super User deletes permission from user by mistake, then restores the permission, then user should still have his scheduled reports working.

@tsteur commented on August 8th 2014 Owner

+1 for "when user loses access to a website, we could delete the reports for this user and website". It works like this already in several other plugins see http://developer.piwik.org/api-reference/events#usersmanagerdeleteuser and it should be already implemented in https://github.com/piwik/piwik/blob/master/plugins/ScheduledReports/ScheduledReports.php#L526

I'll have a look later

This Issue was closed on August 8th 2014
Powered by GitHub Issue Mirror