Make UsersManager.getSitesAccessFromUser work for SuperUsers #6359
Labels
Enhancement
For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Help wanted
Beginner friendly issues or issues where we'd highly appreciate community's help and involvement.
Task
Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone
I'm wondering is there any particular reason why in method
https://github.com/piwik/piwik/blob/master/plugins/UsersManager/API.php#L239
exception is thrown in case current user is super-admin ?
This is public method, which could be useful for pulling out for example default idSite while configuring some features. However it throws error for SuperUser while it actually should probably return all site ids to which superuser has access ?
In other words - since Piwik allows multiple super-admins, this exception makes this method quite unusable in any further way than it is currently. Maybe it would be worth to change this logic and make method more usable ?
Of course I'm open for discussion if there is any generic way to pull out available idsites based on given user login ?
The text was updated successfully, but these errors were encountered: