コード例 #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()))
コード例 #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()))
コード例 #3
0
ファイル: access_approval.py プロジェクト: xutaoding/bmp
    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()
        ))
コード例 #4
0
ファイル: access.py プロジェクト: xutaoding/bmp
    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()
        ))