Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow admin user to copy dashboards #13605

Merged
merged 4 commits into from Nov 29, 2018
Merged

allow admin user to copy dashboards #13605

merged 4 commits into from Nov 29, 2018

Conversation

tsteur
Copy link
Member

@tsteur tsteur commented Oct 14, 2018

fix #13567

@tsteur tsteur added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Oct 14, 2018
@tsteur tsteur added this to the 3.7.0 milestone Oct 14, 2018
}

if (!$userFound) {
throw new \Exception(Piwik::translate('Cannot copy dashboard to user %s, user not found or user does not have access to same site.', $copyToUser));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Guess this should be moved to a translation key, or the Piwik::translate can be removed

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

didn't create translation key similar to the end of the API method where it is also not translated as when triggered through the UI this cannot happen... will remove the piwik translate

@diosmosis
Copy link
Member

Testing locally it seems that even for an admin user it shows the entire list of users in the "Copy dashboard to user" modal. Think this is a security risk.

@tsteur
Copy link
Member Author

tsteur commented Oct 15, 2018

I tested locally here and it didn't. Did you test if the users you see are in the same sites as the admin user?

@diosmosis
Copy link
Member

I had a single site every user had access to, w/o that site it works (though some users still result in the "Cannot copy dashboard to user" error; they probably don't have access to the site).

@tsteur
Copy link
Member Author

tsteur commented Oct 15, 2018

When every user has access to this site, and the user is an admin user, then the user can see all the other users. That's expected. I just tested here again and it works as expected. As admin users you can see all other users that have access to the same site.

say you have

  • site 1 admin access
  • site 2 write access
  • site 3 view access
  • site 4 admin access
  • site 5 admin access
  • site 6 view access

Then you are allowed to see a list of all users that have access to site 1, 4 and 5.

The method UsersManager.getUsers is used to show the list of available users and is also used to validate in the backend.

@diosmosis
Copy link
Member

Some test failures, otherwise looks good to merge & works locally

@tsteur
Copy link
Member Author

tsteur commented Nov 29, 2018

Fixed the test 👍

@tsteur tsteur merged commit 039e62d into 3.x-dev Nov 29, 2018
@tsteur tsteur deleted the 13567 branch November 29, 2018 02:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

admins can't share dashboard with users
3 participants