def list(self, request, userguid=None, ovs_type=None): """ Lists all available Clients where the logged in user has access to :param request: Raw request :type request: Request :param userguid: User guid to filter the clients :type userguid: str :param ovs_type: Filter on the Client's ovs_type :type ovs_type: str """ if Toolbox.is_client_in_roles(request.client, ['manage']): client_list = ClientList.get_clients() else: if ovs_type is not None and ovs_type != 'INTERNAL': client_list = [ client for client in request.client.user.clients if client.ovs_type == ovs_type ] else: client_list = [ client for client in request.client.user.clients if client.ovs_type != 'INTERNAL' ] if userguid is not None: return [ client for client in client_list if client.user_guid == userguid ] return client_list
def list(self, request, userguid=None, ovs_type=None): """ Lists all available Clients where the logged in user has access to """ if Toolbox.is_client_in_roles(request.client, ['manage']): client_list = ClientList.get_clients() else: if ovs_type is not None and ovs_type != 'INTERNAL': client_list = [client for client in request.client.user.clients if client.ovs_type == ovs_type] else: client_list = [client for client in request.client.user.clients if client.ovs_type != 'INTERNAL'] if userguid is not None: return [client for client in client_list if client.user_guid == userguid] return client_list
def list(self, request, userguid=None, ovs_type=None): """ Lists all available Clients where the logged in user has access to """ if Toolbox.is_client_in_roles(request.client, ['manage']): client_list = ClientList.get_clients() else: if ovs_type is not None and ovs_type != 'INTERNAL': client_list = [client for client in request.client.user.clients if client.ovs_type == ovs_type] else: client_list = [client for client in request.client.user.clients if client.ovs_type != 'INTERNAL'] if userguid is not None: return [client for client in client_list if client.user_guid == userguid] return client_list
def list(self, request, userguid=None, ovs_type=None): """ Lists all available Clients where the logged in user has access to :param request: Raw request :type request: Request :param userguid: User guid to filter the clients :type userguid: str :param ovs_type: Filter on the Client's ovs_type :type ovs_type: str """ if Toolbox.is_client_in_roles(request.client, ['manage']): client_list = ClientList.get_clients() else: if ovs_type is not None and ovs_type != 'INTERNAL': client_list = [client for client in request.client.user.clients if client.ovs_type == ovs_type] else: client_list = [client for client in request.client.user.clients if client.ovs_type != 'INTERNAL'] if userguid is not None: return [client for client in client_list if client.user_guid == userguid] return client_list