Exemplo n.º 1
0
    def get(self, page=0, pre_page=None):
        filters = [Access.status == ACCESS.APPROVAL]

        if not session.is_admin() and not session.in_group(DEFAULT_GROUP.OP):
            filters.append(
                or_(Access.apply_uid == session.get_uid(),
                    Access.copy_to_uid.like("%" + session.get_uid() + "%")))

        return self.succ(
            Access.select(page=page,
                          pre_page=pre_page,
                          _filters=filters,
                          _orders=Access.apply_time.desc()))
Exemplo n.º 2
0
    def get(self, page=0, pre_page=None, aid=0):
        if aid:
            return self.succ(Access.get(aid))

        filters = [Access.status == ACCESS.NEW]

        if not session.is_admin() and not session.in_group(DEFAULT_GROUP.OP):
            filters.append(Access.apply_uid == session.get_uid())

        return self.succ(
            Access.select(page=page,
                          pre_page=pre_page,
                          _filters=filters,
                          _orders=Access.apply_time.desc()))
Exemplo n.º 3
0
    def get(self, page=0, pre_page=None):
        filters = [Access.status == ACCESS.APPROVAL]

        if not session.is_admin() and not session.in_group(DEFAULT_GROUP.OP):
            filters.append(or_(
                Access.apply_uid == session.get_uid(),
                Access.copy_to_uid.like("%" + session.get_uid() + "%")
            ))

        return self.succ(Access.select(
            page=page,
            pre_page=pre_page,
            _filters=filters,
            _orders=Access.apply_time.desc()
        ))
Exemplo n.º 4
0
    def get(self, page=0, pre_page=None, aid=0):
        if aid:
            return self.succ(Access.get(aid))

        filters = [Access.status == ACCESS.NEW]

        if not session.is_admin() and not session.in_group(DEFAULT_GROUP.OP):
            filters.append(Access.apply_uid == session.get_uid())

        return self.succ(Access.select(
            page=page,
            pre_page=pre_page,
            _filters=filters,
            _orders=Access.apply_time.desc()
        ))