Loading ccserver/ccserver.py +13 −0 Original line number Diff line number Diff line #!/usr/bin/env python #coding=utf8 ''' Main class of cc-server. ''' from __future__ import absolute_import import logging Loading Loading @@ -208,6 +212,15 @@ class CCServer(object): client.shutdown() def check(self, login, method, tql=None): ''' Check if the user can call the specified method with specified TQL. :param login: the login of the user :param method: the method to call :param tql: the tql passed in argument of the method :return: True if user have rights, else False ''' rights = self.conf.show(login)['rights'] if tql is not None: objects = self.list(tql, pure=True) Loading ccserver/client.py +8 −0 Original line number Diff line number Diff line #!/usr/bin/env python #coding=utf8 ''' Local client representation classes. ''' from threading import RLock from datetime import datetime Loading Loading @@ -64,6 +68,10 @@ class CCClient(object): return ':'.join(peer.split(':')[:-1]) def shutdown(self): ''' Shutdown the connection to the client. ''' self.server.manager.shutdown_client(self.connection.get_fd()) def get_tags(self): Loading Loading
ccserver/ccserver.py +13 −0 Original line number Diff line number Diff line #!/usr/bin/env python #coding=utf8 ''' Main class of cc-server. ''' from __future__ import absolute_import import logging Loading Loading @@ -208,6 +212,15 @@ class CCServer(object): client.shutdown() def check(self, login, method, tql=None): ''' Check if the user can call the specified method with specified TQL. :param login: the login of the user :param method: the method to call :param tql: the tql passed in argument of the method :return: True if user have rights, else False ''' rights = self.conf.show(login)['rights'] if tql is not None: objects = self.list(tql, pure=True) Loading
ccserver/client.py +8 −0 Original line number Diff line number Diff line #!/usr/bin/env python #coding=utf8 ''' Local client representation classes. ''' from threading import RLock from datetime import datetime Loading Loading @@ -64,6 +68,10 @@ class CCClient(object): return ':'.join(peer.split(':')[:-1]) def shutdown(self): ''' Shutdown the connection to the client. ''' self.server.manager.shutdown_client(self.connection.get_fd()) def get_tags(self): Loading