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

Usage with MultiTenancy #12

Closed
Znow opened this issue Jun 12, 2020 · 13 comments
Closed

Usage with MultiTenancy #12

Znow opened this issue Jun 12, 2020 · 13 comments

Comments

@Znow
Copy link

Znow commented Jun 12, 2020

Hi, just started using your module, its awesome!

What is the roadmap for implementing the tenant provider and giving ability to control settings for tenants?

Thanks

@gdlcf88
Copy link
Member

gdlcf88 commented Jun 16, 2020

Did you mean a host-side admin controlling tenant's setting values? If so, you should not do that, the host is not the master of tenants, please think of it as a tenant without TenantId.

@Znow
Copy link
Author

Znow commented Jun 16, 2020

No, what I mean is tenants themself controlling the setting ontop of users. So the tenant "admins" can control the settings, which will be inherited by the users.

So tenant-settings.

Example:

Tenant A needs background color: #000000 from setting
tenant B needs background color: #efefef from setting

Both which will be applied for all users which are either on Tenant A or Tenant B

@gdlcf88
Copy link
Member

gdlcf88 commented Jun 16, 2020

Got it. I think you found a bug.

Hi @wakuflair, I try to grant the setting UI's permission to a tenant-side user, when he changes a setting value, his behavior affects the global setting value:
image

The expected result is that a tenant-side setting data is created, is that so?

@Znow
Copy link
Author

Znow commented Jun 16, 2020

As far as I have seen like the comment above from @gdlcf88, the settings are also global for all users, so is this intended, or actual missing stuff or a bug? :D

@wakuflair
Copy link
Member

Hi guys
Yes the settings value are set by using "global", for now.
Other scopes(Tenant, User, eg.) are on the roadmap.

@gdlcf88
Copy link
Member

gdlcf88 commented Jun 17, 2020

For now, an admin user (from the host or one of the tenants) can grant the setting management permission himself and control the global values. It is dangerous!

Tenants and the host should only control the setting values in their own scope. Even a host admin should not be allowed to change the global values since generally the host is not the master of all the tenants. Maybe SettingUI could provide extra permission and page to manage the global setting values. (the permission is tenant-only, of course).

But it seems ABP has no way to control the setting values for only the host: abpframework/abp#4368

@gdlcf88
Copy link
Member

gdlcf88 commented Jun 17, 2020

About the user-side setting values management, I have these ideas:

  • Provide a dedicated page and permission for users to control the setting values for themself.
  • Show only the setting items with IsVisibleToClients == true.

@gdlcf88
Copy link
Member

gdlcf88 commented Jun 17, 2020

Maybe SettingUI could provide extra permission and page to manage the global setting values. (the permission is tenant-only, of course).

After some consideration, I think the global setting management feature is not reasonable to exist. If an app admin wants to manage a global setting value, he can change the default value or implement the global values management feature himself. All in all, we should not provide an unreasonable design.

@wakuflair
Copy link
Member

he can change the default value or implement the global values management feature himself

Of course he can. But SettingUI is supposed to provide an easy way to set settings value.

For example: An admin wants to set the theme of the entire website through UI.

@gdlcf88
Copy link
Member

gdlcf88 commented Jun 20, 2020

For example: An admin wants to set the theme of the entire website through UI.

He can only change the setting value of the current tenant (for the host-side, the TenantId == null), instead of the global setting value. Because nobody has permission to change a global setting value in ABP multi-tenant design.

@wakuflair
Copy link
Member

wakuflair commented Jun 20, 2020

Is this way available for single tenant applications?

@gdlcf88
Copy link
Member

gdlcf88 commented Jun 20, 2020

I think so, since setting values of single-tenant apps (or we call it host-only apps) will be affected by the setting ProviderName == T with ProviderKey == null.

@wakuflair
Copy link
Member

OK. I'll change SetGlobalAsync to SetForCurrentTenantAsync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants