Loading ccserver/ccserver.py +4 −3 Original line number Diff line number Diff line Loading @@ -200,13 +200,14 @@ class CCServer(object): 'connected' % login) client.shutdown() def check(self, client, method, tql): def check(self, client, method, tql=None): rights = self.conf.show(client.login)['rights'] if tql is not None: objects = self.list(tql, pure=True) for right in rights: if not (right['method'] is None or glob(method, right['method'])): continue if right['tql']: if tql is not None and right['tql']: objects_right = self.list(right['tql'], pure=True) if not objects <= objects_right: continue Loading ccserver/handlers.py +4 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ class OnlineCCHandler(CCHandler): def on_disconnect(self, conn): self._server.unregister(conn) def _check(self, conn, method, tql): def _check(self, conn, method, tql=None): client = self._server.search_client_by_connection(conn) allow = self._server.check(client, method, tql) if not allow: Loading Loading @@ -203,6 +203,9 @@ class CliHandler(OnlineCCHandler): ''' Create a new account with specified login. ''' self._check(conn, 'addaccount') if role in WelcomeHandler.ROLES: self._server.conf.create_account(login, role, password) else: Loading Loading
ccserver/ccserver.py +4 −3 Original line number Diff line number Diff line Loading @@ -200,13 +200,14 @@ class CCServer(object): 'connected' % login) client.shutdown() def check(self, client, method, tql): def check(self, client, method, tql=None): rights = self.conf.show(client.login)['rights'] if tql is not None: objects = self.list(tql, pure=True) for right in rights: if not (right['method'] is None or glob(method, right['method'])): continue if right['tql']: if tql is not None and right['tql']: objects_right = self.list(right['tql'], pure=True) if not objects <= objects_right: continue Loading
ccserver/handlers.py +4 −1 Original line number Diff line number Diff line Loading @@ -80,7 +80,7 @@ class OnlineCCHandler(CCHandler): def on_disconnect(self, conn): self._server.unregister(conn) def _check(self, conn, method, tql): def _check(self, conn, method, tql=None): client = self._server.search_client_by_connection(conn) allow = self._server.check(client, method, tql) if not allow: Loading Loading @@ -203,6 +203,9 @@ class CliHandler(OnlineCCHandler): ''' Create a new account with specified login. ''' self._check(conn, 'addaccount') if role in WelcomeHandler.ROLES: self._server.conf.create_account(login, role, password) else: Loading