umami icon indicating copy to clipboard operation
umami copied to clipboard

Multiple users & sites

Open joshinat0r opened this issue 6 years ago • 9 comments

The current behaviour with multiple users is intended, so its not really a bug. Should be easier if I explain it with an example:

  • User ABC creates a website ABC
  • User ABC creates a user XYZ
  • User XYZ logs into Umami and the dashboard is empty
  • User XYZ creates a website XZY
  • User ABC only sees site ABC
  • User XYZ only sees site XYZ

What I was expecting was:

  • User ABC creates a website ABC
  • User ABC creates a user XYZ
  • User XYZ logs into Umami and can see website ABC

I know that I could enable the share URL, but that also means that user XYZ needs several links if I have several sites (and the stats are visible to everyone with the link). The only solution for me right now is to share my account.

I'm aware that a proper permission system is quite a bit of work, but that would cover all usecases with more granular control over users and which sites they can access.

An easier solution for now might be a .env var that is calling a getAllWebsites() method here that selects all sites, instead of executing this query that only selects sites created by the user.

Not a perfect fix since were either showing all available sites or not enough sites (for my usecase anyways), thats why I first wanted to create an issue. To see if there is a point to a cruel .env parameter or if a permission system is something that other people want/need.

joshinat0r avatar Sep 08 '20 10:09 joshinat0r

Can you explain your use case a little more? Trying to understand what you're trying to accomplish.

Most people will never need to create an account because they are using it for their own websites, so they will just use the default account. Accounts are for people who have clients and they want to host stats for their client's websites. The client can log in with their account and manage everything themselves. You definitely don't want different clients seeing each other's data.

If you're asking if the admin account should be able to see all websites, I think that can be possible. But other accounts should only see their own websites.

mikecao avatar Sep 08 '20 10:09 mikecao

My specific use case would already be solved if the admin-account could view all sites regardless of who created them. Haven't thought about that at all.

The goal is to use Umami for different 3 sites (+ subdomain), which means I would create 3 different users and create with every one of them the necessary sites. Those sites are for clients, and ideally they'd get access to the dashboard. But right now I as the admin have no access to any of those sites because the admin account didn't create a website. Which means if I want to look at the stats I need share the login details.

With a .env param I could spin up 3 instances of Umami where every user can see all sites.
Like I said, not a great solution but it'd be quite a bit easier than a fully fledged permission system.

Anyway, just giving the admin access to all sites would do the trick for me.

joshinat0r avatar Sep 08 '20 11:09 joshinat0r

But why are you creating separate accounts instead of having all websites under a single account?

mikecao avatar Sep 08 '20 14:09 mikecao

Like I said: Those sites are for clients, and ideally they'd get access to the dashboard.

If the admin creates those sites then no other user can see any stats. If the users create those sites then the admin has no access to any of the sites. Giving the admin the ability to view all sites regardless of who created them would fix this.

joshinat0r avatar Sep 08 '20 15:09 joshinat0r

Got it. Ok I can update it so the admin can access other websites. Will probably need to make it a different screen so you don't get mixed up with your own sites.

mikecao avatar Sep 08 '20 16:09 mikecao

@joshinat0r This is now available in the dev branch. Under Accounts there is a new button that let's you jump to an account's dashboard.

mikecao avatar Sep 11 '20 06:09 mikecao

Thanks for resolving this so quickly. Personally would've preferred it if they all showed up on the admins dashboard, but I get why they are separated like they are. Can bookmark the different users dashboards anyways, so it's not like I need to make several clicks every time I want to check all sites.

joshinat0r avatar Sep 11 '20 08:09 joshinat0r

Is this available in Main?

MrChadMWood avatar Jul 05 '23 23:07 MrChadMWood

Yes, in Umami v1 the admin could just view a users complete dashboard.

In v2 that changed, the admin can't jump to a users dashboard anymore, but you can still view all sites.
Just go to Settings > Users > Edit-Button > Websites-Tab > View-Button. Easier to just bookmark the URL if you need to visit them often.

v2 also has Teams. The owner of a website can create a team, add their websites to it and then share an access code.
Other users can use that access code to join the team which allows them to view those shared websites.
But you still need to do a similar amount of clicks (as mentioned in #2050), but you can bookmark those links aswell.

joshinat0r avatar Jul 06 '23 07:07 joshinat0r