Commit 8fbefb8c authored by Antoine Millet's avatar Antoine Millet
Browse files

Little change in server's check method API.

parent fbd2c61d
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -207,8 +207,8 @@ class CCServer(object):
                                           'connected' % login)
        client.shutdown()

    def check(self, client, method, tql=None):
        rights = self.conf.show(client.login)['rights']
    def check(self, login, method, tql=None):
        rights = self.conf.show(login)['rights']
        if tql is not None:
            objects = self.list(tql, pure=True)
        for right in rights:
+1 −1
Original line number Diff line number Diff line
@@ -96,7 +96,7 @@ class OnlineCCHandler(CCHandler):

    def _check(self, conn, method, tql=None):
        client = self._server.search_client_by_connection(conn)
        allow = self._server.check(client, method, tql)
        allow = self._server.check(client.login, method, tql)
        if not allow:
            raise RightError('You are not allowed to do this action.')