Beispiel #1
0
    def post(self):
        ret = self.check_privilege(TP_PRIVILEGE_OPS_AUZ)
        if ret != TPE_OK:
            return

        args = self.get_argument('args', None)
        if args is None:
            return self.write_json(TPE_PARAM)
        try:
            args = json.loads(args)
        except:
            return self.write_json(TPE_JSON_FORMAT)

        try:
            policy_id = int(args['policy_id'])
            flag_record = int(args['flag_record'])
            flag_rdp = int(args['flag_rdp'])
            flag_ssh = int(args['flag_ssh'])
        except:
            log.e('\n')
            return self.write_json(TPE_PARAM)

        err = ops.set_flags(self, policy_id, flag_record, flag_rdp, flag_ssh)
        self.write_json(err)
Beispiel #2
0
    def post(self):
        ret = self.check_privilege(TP_PRIVILEGE_OPS_AUZ)
        if ret != TPE_OK:
            return

        args = self.get_argument('args', None)
        if args is None:
            return self.write_json(TPE_PARAM)
        try:
            args = json.loads(args)
        except:
            return self.write_json(TPE_JSON_FORMAT)

        try:
            policy_id = int(args['policy_id'])
            flag_record = int(args['flag_record'])
            flag_rdp = int(args['flag_rdp'])
            flag_ssh = int(args['flag_ssh'])
        except:
            log.e('\n')
            return self.write_json(TPE_PARAM)

        err = ops.set_flags(self, policy_id, flag_record, flag_rdp, flag_ssh)
        self.write_json(err)