nacos
nacos copied to clipboard
Hide the namespaces for user who has no access in the page header tabs.
In v2.0.3, the admin can create user and namespace, then set privileges on the user to some namespaces. Now when I use the created user account in the admin console, I can see all the namespaces, not only the ones I have privileges but also the ones I have no access. And if I click on the link, it is saying that "Auth failed". It's not user friendly. So please only show the ones I have access on them.
@i will fix it@
@li-xiao-shuang Please assigne to me ,Thank you.
@li-xiao-shuang Please assigne to me ,Thank you.
You can put forward your idea first
Class NamespaceController
's method getNamespaces
does not check permission of current user.The console of nacos use annotation Secured
and NacosAuthManager
's method auth
to check permission. I will add get current user read permission of namespace in class NamespaceController
's method getNamespaces
. @li-xiao-shuang
Use Secured
is suitable or get NacosUser
from Request
?
And NacosUser
add an attribute Set<String> roles
, in method getNamespaces
,get roles from NacosUser .
If user is admin ,then get all TenantInfo
.If not ,query by roles .
After that ,already get all TenantInfos
,then can create Namespace
by TenantInfo
.
@li-xiao-shuang
Is this issue still open?
Class
NamespaceController
's methodgetNamespaces
does not check permission of current user.The console of nacos use annotationSecured
andNacosAuthManager
's methodauth
to check permission. I will add get current user read permission of namespace in classNamespaceController
's methodgetNamespaces
. @li-xiao-shuang
Have you made any progress ?
Can i push my PR ?
Can i sumit my PR ?
yes,very welcome
The auth feature is for check the operation, not check for context. So see all namespace is under expected.
If we want to check the auth for context, we need redesign the auth system. It will cause high changes.
Thanks for your feedback and contribution. But the issue/pull request has not had recent activity more than 180 days. This issue/pull request will be closed if no further activity occurs 7 days later. We may solve this issue in new version. So can you upgrade to newest version and retry? If there are still issues or want to contribute again. Please create new issue or pull request again.