mirror of
https://gitlab.com/crafty-controller/crafty-4.git
synced 2024-08-30 18:23:09 +00:00
Fix role server calculation
This commit is contained in:
parent
b7ef960cf1
commit
5542f792c8
@ -253,6 +253,7 @@ class ServersController(metaclass=Singleton):
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def get_authorized_servers(user_id):
|
def get_authorized_servers(user_id):
|
||||||
|
server_ids = []
|
||||||
server_data: t.List[t.Dict[str, t.Any]] = []
|
server_data: t.List[t.Dict[str, t.Any]] = []
|
||||||
user_roles = HelperUsers.user_role_query(user_id)
|
user_roles = HelperUsers.user_role_query(user_id)
|
||||||
for user in user_roles:
|
for user in user_roles:
|
||||||
@ -260,11 +261,13 @@ class ServersController(metaclass=Singleton):
|
|||||||
user.role_id
|
user.role_id
|
||||||
)
|
)
|
||||||
for role in role_servers:
|
for role in role_servers:
|
||||||
server_data.append(
|
if role.server_id.server_id not in server_ids:
|
||||||
ServersController().get_server_instance_by_id(
|
server_ids.append(role.server_id.server_id)
|
||||||
role.server_id.server_id
|
server_data.append(
|
||||||
|
ServersController().get_server_instance_by_id(
|
||||||
|
role.server_id.server_id
|
||||||
|
)
|
||||||
)
|
)
|
||||||
)
|
|
||||||
|
|
||||||
return server_data
|
return server_data
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user