mirror of
https://github.com/jumpserver/jumpserver.git
synced 2025-07-17 00:11:42 +00:00
fix: 全局组织受权限位控制
This commit is contained in:
parent
d320443c9f
commit
5ec970fab4
@ -783,9 +783,11 @@ class User(AuthMixin, TokenMixin, RoleMixin, MFAMixin, AbstractUser):
|
|||||||
.exclude(name=BuiltinRole.system_user.name)\
|
.exclude(name=BuiltinRole.system_user.name)\
|
||||||
.exists()
|
.exists()
|
||||||
if has_system_role:
|
if has_system_role:
|
||||||
orgs = [Organization.root()] + list(Organization.objects.all())
|
orgs = list(Organization.objects.all())
|
||||||
else:
|
else:
|
||||||
orgs = list(self.orgs.all().distinct())
|
orgs = list(self.orgs.all().distinct())
|
||||||
|
if self.has_perm('orgs.view_rootorg'):
|
||||||
|
orgs = [Organization.root()] + orgs
|
||||||
return orgs
|
return orgs
|
||||||
|
|
||||||
class Meta:
|
class Meta:
|
||||||
|
Loading…
Reference in New Issue
Block a user